@agoric/cosmos 0.35.0-u19.2 → 0.35.0-u21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.clang-format +116 -0
- package/CHANGELOG.md +18 -18
- package/Makefile +38 -67
- package/ante/ante.go +2 -2
- package/ante/inbound_test.go +1 -1
- package/app/app.go +173 -142
- package/app/export.go +6 -6
- package/app/genesis.go +4 -0
- package/app/sim_test.go +299 -50
- package/app/upgrade.go +142 -96
- package/app/upgrade_test.go +63 -0
- package/cmd/agd/agvm.go +1 -1
- package/cmd/agd/main.go +1 -1
- package/cmd/libdaemon/main.go +34 -1
- package/daemon/cmd/root.go +26 -35
- package/daemon/cmd/root_test.go +5 -4
- package/daemon/cmd/testnet.go +221 -95
- package/daemon/main.go +1 -0
- package/git-revision.txt +1 -1
- package/go.mod +93 -58
- package/go.sum +148 -95
- package/package.json +6 -3
- package/proto/agoric/swingset/genesis.proto +7 -11
- package/proto/agoric/swingset/msgs.proto +56 -75
- package/proto/agoric/swingset/query.proto +7 -10
- package/proto/agoric/swingset/swingset.proto +79 -108
- package/proto/agoric/vbank/genesis.proto +5 -5
- package/proto/agoric/vbank/msgs.proto +1 -2
- package/proto/agoric/vbank/vbank.proto +42 -52
- package/proto/agoric/vibc/msgs.proto +8 -11
- package/proto/agoric/vstorage/genesis.proto +6 -9
- package/proto/agoric/vstorage/query.proto +19 -48
- package/proto/agoric/vstorage/vstorage.proto +4 -10
- package/proto/agoric/vtransfer/genesis.proto +7 -7
- package/proto/buf.gen.gogo.yaml +8 -0
- package/proto/buf.gen.pulsar.yaml +17 -0
- package/proto/buf.gen.swagger.yaml +5 -0
- package/proto/buf.yaml +10 -0
- package/scripts/protocgen.sh +14 -21
- package/third_party/proto/amino/amino.proto +79 -0
- package/third_party/proto/cosmos/base/v1beta1/coin.proto +7 -2
- package/third_party/proto/cosmos/ics23/v1/proofs.proto +243 -0
- package/third_party/proto/cosmos/msg/v1/msg.proto +30 -0
- package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +17 -5
- package/third_party/proto/cosmos_proto/cosmos.proto +16 -1
- package/third_party/proto/gogoproto/gogo.proto +2 -2
- package/third_party/proto/google/protobuf/any.proto +6 -3
- package/third_party/proto/ibc/core/channel/v1/channel.proto +1 -1
- package/third_party/proto/ibc/core/client/v1/client.proto +4 -2
- package/types/address_hooks.go +5 -12
- package/types/address_hooks_test.go +34 -34
- package/types/codec.go +23 -0
- package/types/ibc_packet.go +64 -0
- package/types/ibc_packet_test.go +117 -0
- package/vm/client.go +32 -7
- package/vm/proto_json.go +2 -2
- package/x/swingset/abci.go +1 -1
- package/x/swingset/alias.go +0 -1
- package/x/swingset/config.go +1 -1
- package/x/swingset/keeper/extension_snapshotter.go +1 -1
- package/x/swingset/keeper/extension_snapshotter_test.go +1 -1
- package/x/swingset/keeper/keeper.go +1 -1
- package/x/swingset/keeper/keeper_test.go +1 -1
- package/x/swingset/keeper/querier.go +1 -30
- package/x/swingset/keeper/swing_store_exports_handler.go +1 -1
- package/x/swingset/keeper/swing_store_exports_handler_test.go +1 -1
- package/x/swingset/module.go +1 -14
- package/x/swingset/types/default-params.go +24 -16
- package/x/swingset/types/genesis.pb.go +2 -2
- package/x/swingset/types/msgs.pb.go +4 -3
- package/x/swingset/types/msgs_test.go +1 -1
- package/x/swingset/types/query.pb.go +4 -3
- package/x/swingset/types/swingset.pb.go +2 -2
- package/x/vbank/genesis.go +1 -1
- package/x/vbank/keeper/querier.go +1 -21
- package/x/vbank/module.go +1 -16
- package/x/vbank/types/genesis.pb.go +2 -2
- package/x/vbank/types/msgs.pb.go +3 -2
- package/x/vbank/types/query.pb.go +4 -3
- package/x/vbank/types/vbank.pb.go +2 -2
- package/x/vbank/vbank_test.go +95 -16
- package/x/vibc/keeper/keeper.go +8 -5
- package/x/vibc/keeper/migrations.go +36 -0
- package/x/vibc/keeper/triggers.go +6 -32
- package/x/vibc/module.go +9 -17
- package/x/vibc/types/expected_keepers.go +6 -10
- package/x/vibc/types/ibc_module.go +30 -20
- package/x/vibc/types/msgs.go +1 -1
- package/x/vibc/types/msgs.pb.go +5 -4
- package/x/vibc/types/receiver.go +17 -17
- package/x/vlocalchain/keeper/keeper.go +3 -3
- package/x/vlocalchain/types/vlocalchain.pb.go +1 -1
- package/x/vlocalchain/vlocalchain_test.go +6 -6
- package/x/vstorage/README.md +0 -8
- package/x/vstorage/alias.go +0 -1
- package/x/vstorage/client/cli/query.go +1 -1
- package/x/vstorage/genesis.go +1 -1
- package/x/vstorage/keeper/keeper.go +40 -5
- package/x/vstorage/keeper/keeper_test.go +24 -24
- package/x/vstorage/keeper/querier.go +1 -32
- package/x/vstorage/keeper/querier_test.go +41 -6
- package/x/vstorage/module.go +1 -14
- package/x/vstorage/types/genesis.pb.go +2 -2
- package/x/vstorage/types/path_keys.go +7 -8
- package/x/vstorage/types/query.pb.go +8 -5
- package/x/vstorage/types/vstorage.pb.go +2 -2
- package/x/vstorage/vstorage_test.go +3 -3
- package/x/vtransfer/genesis.go +1 -1
- package/x/vtransfer/handler.go +4 -2
- package/x/vtransfer/ibc_middleware.go +4 -4
- package/x/vtransfer/ibc_middleware_test.go +14 -16
- package/x/vtransfer/keeper/keeper.go +38 -48
- package/x/vtransfer/module.go +1 -14
- package/x/vtransfer/types/expected_keepers.go +2 -18
- package/x/vtransfer/types/genesis.pb.go +2 -2
- package/x/vtransfer/utils_test.go +15 -15
- package/daemon/cmd/genaccounts.go +0 -195
- package/e2e_test/Makefile +0 -29
- package/e2e_test/README.md +0 -100
- package/e2e_test/go.mod +0 -239
- package/e2e_test/go.sum +0 -1323
- package/e2e_test/ibc_conformance_test.go +0 -56
- package/e2e_test/pfm_test.go +0 -613
- package/e2e_test/util.go +0 -271
|
@@ -8,67 +8,57 @@ option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vbank/types";
|
|
|
8
8
|
|
|
9
9
|
// The module governance/configuration parameters.
|
|
10
10
|
message Params {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
option (gogoproto.equal) = true;
|
|
12
|
+
option (gogoproto.goproto_stringer) = false;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
(gogoproto.moretags) = "yaml:\"reward_epoch_duration_blocks\""
|
|
19
|
-
];
|
|
14
|
+
// reward_epoch_duration_blocks is the length of a reward epoch, in blocks.
|
|
15
|
+
// A value of zero has the same meaning as a value of one:
|
|
16
|
+
// the full reward buffer should be distributed immediately.
|
|
17
|
+
int64 reward_epoch_duration_blocks = 1 [(gogoproto.moretags) = "yaml:\"reward_epoch_duration_blocks\""];
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
// per_epoch_reward_fraction is a fraction of the reward pool to distrubute
|
|
20
|
+
// once every reward epoch. If less than zero, use approximately continuous
|
|
21
|
+
// per-block distribution.
|
|
22
|
+
string per_epoch_reward_fraction = 2 [
|
|
23
|
+
(gogoproto.moretags) = "yaml:\"discrete_epoch_reward_fraction\"",
|
|
24
|
+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
|
|
25
|
+
(gogoproto.nullable) = false
|
|
26
|
+
];
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(gogoproto.moretags) = "yaml:\"reward_smoothing_blocks\""
|
|
35
|
-
];
|
|
28
|
+
// reward_smoothing_blocks is the number of blocks over which to distribute
|
|
29
|
+
// an epoch's rewards. If zero, use the same value as
|
|
30
|
+
// reward_epoch_duration_blocks.
|
|
31
|
+
int64 reward_smoothing_blocks = 3 [(gogoproto.moretags) = "yaml:\"reward_smoothing_blocks\""];
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(gogoproto.moretags) = "yaml:\"allowed_monitoring_accounts\""
|
|
42
|
-
];
|
|
33
|
+
// allowed_monitoring_accounts is an array of account addresses that can be
|
|
34
|
+
// monitored for sends and receives. An element of `"*"` will permit any
|
|
35
|
+
// address.
|
|
36
|
+
repeated string allowed_monitoring_accounts = 4 [(gogoproto.moretags) = "yaml:\"allowed_monitoring_accounts\""];
|
|
43
37
|
}
|
|
44
38
|
|
|
45
39
|
// The current state of the module.
|
|
46
40
|
message State {
|
|
47
|
-
|
|
41
|
+
option (gogoproto.equal) = true;
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
// rewardPool is the current balance of rewards in the module account.
|
|
44
|
+
// NOTE: Tracking manually since there is no bank call for getting a
|
|
45
|
+
// module account balance by name.
|
|
46
|
+
repeated cosmos.base.v1beta1.Coin reward_pool = 1 [
|
|
47
|
+
(gogoproto.nullable) = false,
|
|
48
|
+
(gogoproto.moretags) = "yaml:\"reward_pool\"",
|
|
49
|
+
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
|
50
|
+
];
|
|
57
51
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// last_sequence is a sequence number for communicating with the VM.
|
|
67
|
-
uint64 last_sequence = 3 [
|
|
68
|
-
(gogoproto.moretags) = "yaml:\"last_sequence\""
|
|
69
|
-
];
|
|
52
|
+
// reward_block_amount is the amount of reward, if available, to send to the
|
|
53
|
+
// fee collector module on every block.
|
|
54
|
+
repeated cosmos.base.v1beta1.Coin reward_block_amount = 2 [
|
|
55
|
+
(gogoproto.nullable) = false,
|
|
56
|
+
(gogoproto.moretags) = "yaml:\"reward_block_amount\"",
|
|
57
|
+
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
|
58
|
+
];
|
|
70
59
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
// last_sequence is a sequence number for communicating with the VM.
|
|
61
|
+
uint64 last_sequence = 3 [(gogoproto.moretags) = "yaml:\"last_sequence\""];
|
|
62
|
+
|
|
63
|
+
int64 last_reward_distribution_block = 4 [(gogoproto.moretags) = "yaml:\"last_reward_distribution_block\""];
|
|
74
64
|
}
|
|
@@ -14,18 +14,15 @@ service Msg {
|
|
|
14
14
|
|
|
15
15
|
// MsgSendPacket is an SDK message for sending an outgoing IBC packet
|
|
16
16
|
message MsgSendPacket {
|
|
17
|
-
|
|
17
|
+
option (gogoproto.equal) = false;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(gogoproto.jsontag) = "submitter",
|
|
27
|
-
(gogoproto.moretags) = "yaml:\"submitter\""
|
|
28
|
-
];
|
|
19
|
+
ibc.core.channel.v1.Packet packet = 1
|
|
20
|
+
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "packet", (gogoproto.moretags) = "yaml:\"packet\""];
|
|
21
|
+
bytes sender = 2 [
|
|
22
|
+
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
|
|
23
|
+
(gogoproto.jsontag) = "submitter",
|
|
24
|
+
(gogoproto.moretags) = "yaml:\"submitter\""
|
|
25
|
+
];
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
// Empty response for SendPacket.
|
|
@@ -7,19 +7,16 @@ option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage/types
|
|
|
7
7
|
|
|
8
8
|
// The initial or exported state.
|
|
9
9
|
message GenesisState {
|
|
10
|
-
|
|
10
|
+
option (gogoproto.equal) = false;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
(gogoproto.jsontag) = "data",
|
|
14
|
-
(gogoproto.moretags) = "yaml:\"data\""
|
|
15
|
-
];
|
|
12
|
+
repeated DataEntry data = 1 [(gogoproto.jsontag) = "data", (gogoproto.moretags) = "yaml:\"data\""];
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
// A vstorage entry. The only necessary entries are those with data, as the
|
|
19
16
|
// ancestor nodes are reconstructed on import.
|
|
20
17
|
message DataEntry {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
// A "."-separated path with individual path elements matching
|
|
19
|
+
// `[-_A-Za-z0-9]+`
|
|
20
|
+
string path = 1;
|
|
21
|
+
string value = 2;
|
|
25
22
|
}
|
|
@@ -16,95 +16,66 @@ service Query {
|
|
|
16
16
|
|
|
17
17
|
// Return a formatted representation of a vstorage datum that must be
|
|
18
18
|
// a valid StreamCell with CapData values, or standalone CapData.
|
|
19
|
-
rpc CapData(QueryCapDataRequest)
|
|
20
|
-
|
|
21
|
-
option (google.api.http).get = "/agoric/vstorage/capdata/{path}";
|
|
19
|
+
rpc CapData(QueryCapDataRequest) returns (QueryCapDataResponse) {
|
|
20
|
+
option (google.api.http).get = "/agoric/vstorage/capdata/{path}";
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
// Return the children of a given vstorage path.
|
|
25
|
-
rpc Children(QueryChildrenRequest)
|
|
26
|
-
|
|
27
|
-
option (google.api.http).get = "/agoric/vstorage/children/{path}";
|
|
24
|
+
rpc Children(QueryChildrenRequest) returns (QueryChildrenResponse) {
|
|
25
|
+
option (google.api.http).get = "/agoric/vstorage/children/{path}";
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
// QueryDataRequest is the vstorage path data query.
|
|
32
30
|
message QueryDataRequest {
|
|
33
|
-
string path = 1 [
|
|
34
|
-
(gogoproto.jsontag) = "path",
|
|
35
|
-
(gogoproto.moretags) = "yaml:\"path\""
|
|
36
|
-
];
|
|
31
|
+
string path = 1 [(gogoproto.jsontag) = "path", (gogoproto.moretags) = "yaml:\"path\""];
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
// QueryDataResponse is the vstorage path data response.
|
|
40
35
|
message QueryDataResponse {
|
|
41
|
-
string value = 1 [
|
|
42
|
-
(gogoproto.jsontag) = "value",
|
|
43
|
-
(gogoproto.moretags) = "yaml:\"value\""
|
|
44
|
-
];
|
|
36
|
+
string value = 1 [(gogoproto.jsontag) = "value", (gogoproto.moretags) = "yaml:\"value\""];
|
|
45
37
|
}
|
|
46
38
|
|
|
47
39
|
// QueryCapDataRequest contains a path and formatting configuration.
|
|
48
40
|
message QueryCapDataRequest {
|
|
49
|
-
string path = 1 [
|
|
50
|
-
(gogoproto.jsontag) = "path",
|
|
51
|
-
(gogoproto.moretags) = "yaml:\"path\""
|
|
52
|
-
];
|
|
41
|
+
string path = 1 [(gogoproto.jsontag) = "path", (gogoproto.moretags) = "yaml:\"path\""];
|
|
53
42
|
// mediaType must be an actual media type in the registry at
|
|
54
43
|
// https://www.iana.org/assignments/media-types/media-types.xhtml
|
|
55
44
|
// or a special value that does not conflict with the media type syntax.
|
|
56
45
|
// The only valid value is "JSON Lines", which is also the default.
|
|
57
|
-
string media_type = 2 [
|
|
58
|
-
(gogoproto.jsontag) = "mediaType",
|
|
59
|
-
(gogoproto.moretags) = "yaml:\"mediaType\""
|
|
60
|
-
];
|
|
46
|
+
string media_type = 2 [(gogoproto.jsontag) = "mediaType", (gogoproto.moretags) = "yaml:\"mediaType\""];
|
|
61
47
|
// itemFormat, if present, must be the special value "flat" to indicate that
|
|
62
48
|
// the deep structure of each item should be flattened into a single level
|
|
63
49
|
// with kebab-case keys (e.g., `{ "metrics": { "min": 0, "max": 88 } }` as
|
|
64
50
|
// `{ "metrics-min": 0, "metrics-max": 88 }`).
|
|
65
|
-
string item_format = 3 [
|
|
66
|
-
(gogoproto.jsontag) = "itemFormat",
|
|
67
|
-
(gogoproto.moretags) = "yaml:\"itemFormat\""
|
|
68
|
-
];
|
|
51
|
+
string item_format = 3 [(gogoproto.jsontag) = "itemFormat", (gogoproto.moretags) = "yaml:\"itemFormat\""];
|
|
69
52
|
// remotableValueFormat indicates how to transform references to opaque but
|
|
70
53
|
// distinguishable Remotables into readable embedded representations.
|
|
71
|
-
// * "object" represents each Remotable as an `{ id, allegedName }` object, e.g. `{ "id": "board007", "allegedName":
|
|
72
|
-
//
|
|
73
|
-
string
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
54
|
+
// * "object" represents each Remotable as an `{ id, allegedName }` object, e.g. `{ "id": "board007", "allegedName":
|
|
55
|
+
// "IST brand" }`.
|
|
56
|
+
// * "string" represents each Remotable as a string with bracket-wrapped contents including its alleged name and id,
|
|
57
|
+
// e.g. "[Alleged: IST brand <board007>]".
|
|
58
|
+
string remotable_value_format = 10
|
|
59
|
+
[(gogoproto.jsontag) = "remotableValueFormat", (gogoproto.moretags) = "yaml:\"remotableValueFormat\""];
|
|
77
60
|
}
|
|
78
61
|
|
|
79
62
|
// QueryCapDataResponse represents the result with the requested formatting,
|
|
80
63
|
// reserving space for future metadata such as media type.
|
|
81
64
|
message QueryCapDataResponse {
|
|
82
|
-
string block_height = 1 [
|
|
83
|
-
|
|
84
|
-
(gogoproto.moretags) = "yaml:\"blockHeight\""
|
|
85
|
-
];
|
|
86
|
-
string value = 10 [
|
|
87
|
-
(gogoproto.jsontag) = "value",
|
|
88
|
-
(gogoproto.moretags) = "yaml:\"value\""
|
|
89
|
-
];
|
|
65
|
+
string block_height = 1 [(gogoproto.jsontag) = "blockHeight", (gogoproto.moretags) = "yaml:\"blockHeight\""];
|
|
66
|
+
string value = 10 [(gogoproto.jsontag) = "value", (gogoproto.moretags) = "yaml:\"value\""];
|
|
90
67
|
}
|
|
91
68
|
|
|
92
69
|
// QueryChildrenRequest is the vstorage path children query.
|
|
93
70
|
message QueryChildrenRequest {
|
|
94
|
-
string path = 1 [
|
|
95
|
-
(gogoproto.jsontag) = "path",
|
|
96
|
-
(gogoproto.moretags) = "yaml:\"path\""
|
|
97
|
-
];
|
|
71
|
+
string path = 1 [(gogoproto.jsontag) = "path", (gogoproto.moretags) = "yaml:\"path\""];
|
|
98
72
|
|
|
99
73
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
|
100
74
|
}
|
|
101
75
|
|
|
102
76
|
// QueryChildrenResponse is the vstorage path children response.
|
|
103
77
|
message QueryChildrenResponse {
|
|
104
|
-
repeated string children = 1 [
|
|
105
|
-
(gogoproto.jsontag) = "children",
|
|
106
|
-
(gogoproto.moretags) = "yaml:\"children\""
|
|
107
|
-
];
|
|
78
|
+
repeated string children = 1 [(gogoproto.jsontag) = "children", (gogoproto.moretags) = "yaml:\"children\""];
|
|
108
79
|
|
|
109
80
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
|
110
81
|
}
|
|
@@ -7,21 +7,15 @@ option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage/types
|
|
|
7
7
|
|
|
8
8
|
// Data is the vstorage node data.
|
|
9
9
|
message Data {
|
|
10
|
-
|
|
10
|
+
option (gogoproto.equal) = false;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
(gogoproto.jsontag) = "value",
|
|
14
|
-
(gogoproto.moretags) = "yaml:\"value\""
|
|
15
|
-
];
|
|
12
|
+
string value = 1 [(gogoproto.jsontag) = "value", (gogoproto.moretags) = "yaml:\"value\""];
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
// Children are the immediate names (just one level deep) of subnodes leading to
|
|
19
16
|
// more data from a given vstorage node.
|
|
20
17
|
message Children {
|
|
21
|
-
|
|
18
|
+
option (gogoproto.equal) = false;
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
(gogoproto.jsontag) = "children",
|
|
25
|
-
(gogoproto.moretags) = "yaml:\"children\""
|
|
26
|
-
];
|
|
20
|
+
repeated string children = 1 [(gogoproto.jsontag) = "children", (gogoproto.moretags) = "yaml:\"children\""];
|
|
27
21
|
}
|
|
@@ -7,12 +7,12 @@ option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vtransfer/type
|
|
|
7
7
|
|
|
8
8
|
// The initial and exported module state.
|
|
9
9
|
message GenesisState {
|
|
10
|
-
|
|
10
|
+
option (gogoproto.equal) = false;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
// The list of account addresses that are being watched by the VM.
|
|
13
|
+
repeated bytes watched_addresses = 1 [
|
|
14
|
+
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress",
|
|
15
|
+
(gogoproto.jsontag) = "watched_addresses",
|
|
16
|
+
(gogoproto.moretags) = "yaml:\"watched_addresses\""
|
|
17
|
+
];
|
|
18
18
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: v1
|
|
2
|
+
managed:
|
|
3
|
+
enabled: true
|
|
4
|
+
go_package_prefix:
|
|
5
|
+
default: cosmossdk.io/api
|
|
6
|
+
except:
|
|
7
|
+
- buf.build/googleapis/googleapis
|
|
8
|
+
- buf.build/cosmos/gogo-proto
|
|
9
|
+
- buf.build/cosmos/cosmos-proto
|
|
10
|
+
override:
|
|
11
|
+
plugins:
|
|
12
|
+
- name: go-pulsar
|
|
13
|
+
out: ../api
|
|
14
|
+
opt: paths=source_relative
|
|
15
|
+
- name: go-grpc
|
|
16
|
+
out: ../api
|
|
17
|
+
opt: paths=source_relative
|
package/proto/buf.yaml
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
version: v1
|
|
2
|
+
build:
|
|
3
|
+
excludes:
|
|
4
|
+
- google/protobuf
|
|
2
5
|
breaking:
|
|
3
6
|
use:
|
|
4
7
|
- FILE
|
|
8
|
+
ignore:
|
|
9
|
+
- gogoproto
|
|
10
|
+
- google
|
|
5
11
|
lint:
|
|
6
12
|
use:
|
|
7
13
|
- DEFAULT
|
|
@@ -13,3 +19,7 @@ lint:
|
|
|
13
19
|
- SERVICE_SUFFIX
|
|
14
20
|
- PACKAGE_VERSION_SUFFIX
|
|
15
21
|
- RPC_REQUEST_STANDARD_NAME
|
|
22
|
+
ignore:
|
|
23
|
+
- cosmos_proto
|
|
24
|
+
- gogoproto
|
|
25
|
+
- google
|
package/scripts/protocgen.sh
CHANGED
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if ! grep "github.com/gogo/protobuf => github.com/regen-network/protobuf" go.mod &> /dev/null; then
|
|
7
|
-
echo -e "\tPlease run this command from somewhere inside the ibc-go folder."
|
|
8
|
-
return 1
|
|
9
|
-
fi
|
|
10
|
-
|
|
11
|
-
go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest 2> /dev/null
|
|
12
|
-
}
|
|
3
|
+
# How to run manually:
|
|
4
|
+
# docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools"
|
|
5
|
+
# docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh
|
|
13
6
|
|
|
14
|
-
|
|
7
|
+
set -eo pipefail
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
echo "Generating gogo proto code"
|
|
10
|
+
cd proto
|
|
11
|
+
proto_dirs=$(find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
|
|
17
12
|
for dir in $proto_dirs; do
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-I proto \
|
|
23
|
-
-I third_party/proto \
|
|
24
|
-
--gocosmos_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
|
|
25
|
-
--grpc-gateway_out=logtostderr=true,allow_colon_final_segments=true:. \
|
|
26
|
-
$(find "${dir}" -maxdepth 1 -name '*.proto')
|
|
13
|
+
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
|
|
14
|
+
echo "Generating gogo proto code for $file"
|
|
15
|
+
buf generate --template buf.gen.gogo.yaml "$file"
|
|
16
|
+
done
|
|
27
17
|
done
|
|
18
|
+
cd ..
|
|
28
19
|
|
|
29
20
|
# move proto files to the right places
|
|
30
21
|
cp -r github.com/Agoric/agoric-sdk/golang/cosmos/* ./
|
|
31
22
|
rm -rf github.com
|
|
23
|
+
|
|
24
|
+
go mod tidy
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package amino;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/descriptor.proto";
|
|
6
|
+
|
|
7
|
+
// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated.
|
|
8
|
+
// We need this right now because gogoproto codegen needs to import the extension.
|
|
9
|
+
option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino";
|
|
10
|
+
|
|
11
|
+
extend google.protobuf.MessageOptions {
|
|
12
|
+
// name is the string used when registering a concrete
|
|
13
|
+
// type into the Amino type registry, via the Amino codec's
|
|
14
|
+
// `RegisterConcrete()` method. This string MUST be at most 39
|
|
15
|
+
// characters long, or else the message will be rejected by the
|
|
16
|
+
// Ledger hardware device.
|
|
17
|
+
string name = 11110001;
|
|
18
|
+
|
|
19
|
+
// encoding describes the encoding format used by Amino for the given
|
|
20
|
+
// message. The field type is chosen to be a string for
|
|
21
|
+
// flexibility, but it should ideally be short and expected to be
|
|
22
|
+
// machine-readable, for example "base64" or "utf8_json". We
|
|
23
|
+
// highly recommend to use underscores for word separation instead of spaces.
|
|
24
|
+
//
|
|
25
|
+
// If left empty, then the Amino encoding is expected to be the same as the
|
|
26
|
+
// Protobuf one.
|
|
27
|
+
//
|
|
28
|
+
// This annotation should not be confused with the `encoding`
|
|
29
|
+
// one which operates on the field level.
|
|
30
|
+
string message_encoding = 11110002;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
extend google.protobuf.FieldOptions {
|
|
34
|
+
// encoding describes the encoding format used by Amino for
|
|
35
|
+
// the given field. The field type is chosen to be a string for
|
|
36
|
+
// flexibility, but it should ideally be short and expected to be
|
|
37
|
+
// machine-readable, for example "base64" or "utf8_json". We
|
|
38
|
+
// highly recommend to use underscores for word separation instead of spaces.
|
|
39
|
+
//
|
|
40
|
+
// If left empty, then the Amino encoding is expected to be the same as the
|
|
41
|
+
// Protobuf one.
|
|
42
|
+
//
|
|
43
|
+
// This annotation should not be confused with the
|
|
44
|
+
// `message_encoding` one which operates on the message level.
|
|
45
|
+
string encoding = 11110003;
|
|
46
|
+
|
|
47
|
+
// field_name sets a different field name (i.e. key name) in
|
|
48
|
+
// the amino JSON object for the given field.
|
|
49
|
+
//
|
|
50
|
+
// Example:
|
|
51
|
+
//
|
|
52
|
+
// message Foo {
|
|
53
|
+
// string bar = 1 [(amino.field_name) = "baz"];
|
|
54
|
+
// }
|
|
55
|
+
//
|
|
56
|
+
// Then the Amino encoding of Foo will be:
|
|
57
|
+
// `{"baz":"some value"}`
|
|
58
|
+
string field_name = 11110004;
|
|
59
|
+
|
|
60
|
+
// dont_omitempty sets the field in the JSON object even if
|
|
61
|
+
// its value is empty, i.e. equal to the Golang zero value. To learn what
|
|
62
|
+
// the zero values are, see https://go.dev/ref/spec#The_zero_value.
|
|
63
|
+
//
|
|
64
|
+
// Fields default to `omitempty`, which is the default behavior when this
|
|
65
|
+
// annotation is unset. When set to true, then the field value in the
|
|
66
|
+
// JSON object will be set, i.e. not `undefined`.
|
|
67
|
+
//
|
|
68
|
+
// Example:
|
|
69
|
+
//
|
|
70
|
+
// message Foo {
|
|
71
|
+
// string bar = 1;
|
|
72
|
+
// string baz = 2 [(amino.dont_omitempty) = true];
|
|
73
|
+
// }
|
|
74
|
+
//
|
|
75
|
+
// f := Foo{};
|
|
76
|
+
// out := AminoJSONEncoder(&f);
|
|
77
|
+
// out == {"baz":""}
|
|
78
|
+
bool dont_omitempty = 11110005;
|
|
79
|
+
}
|
|
@@ -3,6 +3,7 @@ package cosmos.base.v1beta1;
|
|
|
3
3
|
|
|
4
4
|
import "gogoproto/gogo.proto";
|
|
5
5
|
import "cosmos_proto/cosmos.proto";
|
|
6
|
+
import "amino/amino.proto";
|
|
6
7
|
|
|
7
8
|
option go_package = "github.com/cosmos/cosmos-sdk/types";
|
|
8
9
|
option (gogoproto.goproto_stringer_all) = false;
|
|
@@ -16,8 +17,12 @@ message Coin {
|
|
|
16
17
|
option (gogoproto.equal) = true;
|
|
17
18
|
|
|
18
19
|
string denom = 1;
|
|
19
|
-
string amount = 2
|
|
20
|
-
|
|
20
|
+
string amount = 2 [
|
|
21
|
+
(cosmos_proto.scalar) = "cosmos.Int",
|
|
22
|
+
(gogoproto.customtype) = "Int",
|
|
23
|
+
(gogoproto.nullable) = false,
|
|
24
|
+
(amino.dont_omitempty) = true
|
|
25
|
+
];
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
// DecCoin defines a token with a denomination and a decimal amount.
|