@agoric/cosmos 0.34.1 → 0.34.2-calypso-dev-dabccdc.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/MAINTAINERS.md +3 -0
- package/Makefile +67 -41
- package/agoric/config.go +35 -0
- package/ante/ante.go +65 -0
- package/ante/expected_keepers.go +26 -0
- package/ante/inbound.go +137 -0
- package/ante/inbound_test.go +228 -0
- package/ante/vm_admission.go +65 -0
- package/app/app.go +396 -211
- package/app/export.go +13 -9
- package/app/sim_test.go +4 -4
- package/app/upgrade.go +215 -0
- package/binding.gyp.in +29 -4
- package/buf.work.yaml +4 -0
- package/cmd/agd/agvm.go +42 -0
- package/cmd/agd/find_binary.go +22 -7
- package/cmd/agd/main.go +133 -10
- package/cmd/libdaemon/main.go +67 -53
- package/cmd/libdaemon/main_test.go +37 -0
- package/daemon/cmd/genaccounts.go +22 -18
- package/daemon/cmd/root.go +253 -52
- package/daemon/cmd/root_test.go +190 -2
- package/daemon/cmd/testnet.go +17 -6
- package/daemon/main.go +6 -3
- package/e2e_test/Makefile +29 -0
- package/e2e_test/README.md +100 -0
- package/e2e_test/go.mod +217 -0
- package/e2e_test/go.sum +1323 -0
- package/e2e_test/ibc_conformance_test.go +56 -0
- package/e2e_test/pfm_test.go +613 -0
- package/e2e_test/util.go +271 -0
- package/git-revision.txt +1 -0
- package/go.mod +207 -0
- package/go.sum +1877 -0
- package/package.json +13 -21
- package/proto/agoric/swingset/genesis.proto +14 -0
- package/proto/agoric/swingset/swingset.proto +6 -3
- package/proto/agoric/vlocalchain/.clang-format +7 -0
- package/proto/agoric/vlocalchain/vlocalchain.proto +31 -0
- package/proto/agoric/vstorage/query.proto +53 -1
- package/proto/agoric/vtransfer/genesis.proto +18 -0
- package/scripts/protocgen.sh +16 -6
- package/third_party/proto/buf.yaml +1 -0
- package/third_party/proto/cosmos/base/query/v1beta1/pagination.proto +4 -1
- package/third_party/proto/cosmos/base/v1beta1/coin.proto +7 -4
- package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +16 -6
- package/third_party/proto/cosmos_proto/cosmos.proto +97 -0
- package/third_party/proto/google/api/annotations.proto +1 -1
- package/third_party/proto/google/api/http.proto +181 -120
- package/third_party/proto/google/api/httpbody.proto +9 -6
- package/third_party/proto/google/protobuf/any.proto +1 -7
- package/third_party/proto/ibc/core/channel/v1/channel.proto +15 -1
- package/third_party/proto/ibc/core/client/v1/client.proto +9 -6
- package/tools/tools.go +11 -0
- package/types/events.go +41 -0
- package/types/kv_entry.go +114 -0
- package/types/kv_entry_helpers.go +276 -0
- package/types/kv_entry_helpers_test.go +237 -0
- package/types/kv_entry_test.go +143 -0
- package/upgradegaia.sh +75 -0
- package/vm/action.go +134 -0
- package/vm/action_test.go +149 -0
- package/vm/client.go +113 -0
- package/vm/client_test.go +182 -0
- package/vm/controller.go +49 -0
- package/vm/core_proposals.go +51 -0
- package/vm/jsonrpcconn/jsonrpcconn.go +160 -0
- package/vm/jsonrpcconn/jsonrpcconn_test.go +126 -0
- package/vm/proto_json.go +38 -0
- package/vm/proto_json_test.go +103 -0
- package/vm/server.go +124 -0
- package/x/swingset/abci.go +26 -37
- package/x/swingset/alias.go +9 -6
- package/x/swingset/client/cli/query.go +2 -2
- package/x/swingset/client/cli/tx.go +52 -33
- package/x/swingset/client/proposal_handler.go +2 -17
- package/x/swingset/genesis.go +163 -37
- package/x/swingset/handler.go +2 -1
- package/x/swingset/keeper/extension_snapshotter.go +309 -0
- package/x/swingset/keeper/extension_snapshotter_test.go +104 -0
- package/x/swingset/keeper/keeper.go +95 -48
- package/x/swingset/keeper/keeper_test.go +77 -0
- package/x/swingset/keeper/migrations.go +7 -2
- package/x/swingset/keeper/msg_server.go +71 -56
- package/x/swingset/keeper/proposal.go +15 -9
- package/x/swingset/keeper/querier.go +24 -15
- package/x/swingset/keeper/swing_store_exports_handler.go +872 -0
- package/x/swingset/keeper/swing_store_exports_handler_test.go +247 -0
- package/x/swingset/keeper/test_utils.go +16 -0
- package/x/swingset/module.go +33 -11
- package/x/swingset/proposal_handler.go +5 -4
- package/x/swingset/swingset.go +73 -0
- package/x/swingset/testing/queue.go +17 -0
- package/x/swingset/types/codec.go +2 -2
- package/x/swingset/types/default-params.go +23 -17
- package/x/swingset/types/expected_keepers.go +14 -2
- package/x/swingset/types/genesis.pb.go +361 -18
- package/x/swingset/types/msgs.go +87 -26
- package/x/swingset/types/msgs.pb.go +16 -16
- package/x/swingset/types/params.go +76 -1
- package/x/swingset/types/params_test.go +116 -0
- package/x/swingset/types/proposal.go +10 -9
- package/x/swingset/types/swingset.pb.go +83 -81
- package/x/swingset/types/types.go +30 -28
- package/x/vbank/genesis.go +0 -2
- package/x/vbank/handler.go +2 -1
- package/x/vbank/keeper/keeper.go +3 -2
- package/x/vbank/keeper/querier.go +9 -4
- package/x/vbank/keeper/rewards.go +1 -1
- package/x/vbank/module.go +0 -5
- package/x/vbank/types/msgs.go +0 -12
- package/x/vbank/vbank.go +34 -32
- package/x/vbank/vbank_test.go +20 -20
- package/x/vibc/alias.go +3 -0
- package/x/vibc/handler.go +17 -15
- package/x/vibc/keeper/keeper.go +113 -89
- package/x/vibc/keeper/triggers.go +101 -0
- package/x/vibc/module.go +5 -8
- package/x/vibc/types/expected_keepers.go +28 -6
- package/x/vibc/types/ibc_module.go +336 -0
- package/x/vibc/types/msgs.go +1 -1
- package/x/vibc/types/msgs.pb.go +1 -1
- package/x/vibc/types/receiver.go +170 -0
- package/x/vlocalchain/alias.go +19 -0
- package/x/vlocalchain/handler.go +21 -0
- package/x/vlocalchain/keeper/keeper.go +279 -0
- package/x/vlocalchain/keeper/keeper_test.go +97 -0
- package/x/vlocalchain/types/codec.go +34 -0
- package/x/vlocalchain/types/key.go +27 -0
- package/x/vlocalchain/types/msgs.go +16 -0
- package/x/vlocalchain/types/vlocalchain.pb.go +1072 -0
- package/x/vlocalchain/vlocalchain.go +114 -0
- package/x/vlocalchain/vlocalchain_test.go +434 -0
- package/x/vstorage/README.md +138 -0
- package/x/vstorage/capdata/capdata.go +298 -0
- package/x/vstorage/capdata/capdata_test.go +352 -0
- package/x/vstorage/client/cli/query.go +51 -4
- package/x/vstorage/genesis.go +0 -3
- package/x/vstorage/handler.go +2 -1
- package/x/vstorage/keeper/grpc_query.go +220 -0
- package/x/vstorage/keeper/keeper.go +75 -57
- package/x/vstorage/keeper/keeper_grpc_test.go +300 -0
- package/x/vstorage/keeper/keeper_test.go +40 -62
- package/x/vstorage/keeper/querier.go +39 -14
- package/x/vstorage/keeper/querier_test.go +113 -0
- package/x/vstorage/module.go +0 -5
- package/x/vstorage/testing/queue.go +27 -0
- package/x/vstorage/types/path_keys.go +22 -10
- package/x/vstorage/types/path_keys_test.go +84 -18
- package/x/vstorage/types/query.pb.go +646 -36
- package/x/vstorage/types/query.pb.gw.go +119 -0
- package/x/vstorage/types/types.go +0 -66
- package/x/vstorage/vstorage.go +33 -35
- package/x/vstorage/vstorage_test.go +19 -19
- package/x/vtransfer/alias.go +13 -0
- package/x/vtransfer/genesis.go +39 -0
- package/x/vtransfer/genesis_test.go +12 -0
- package/x/vtransfer/handler.go +20 -0
- package/x/vtransfer/ibc_middleware.go +186 -0
- package/x/vtransfer/ibc_middleware_test.go +448 -0
- package/x/vtransfer/keeper/keeper.go +281 -0
- package/x/vtransfer/module.go +124 -0
- package/x/vtransfer/types/expected_keepers.go +38 -0
- package/x/vtransfer/types/genesis.pb.go +327 -0
- package/x/vtransfer/types/key.go +9 -0
- package/x/vtransfer/types/msgs.go +9 -0
- package/app/const.go +0 -6
- package/cmd/helper/main.go +0 -21
- package/proto/agoric/lien/genesis.proto +0 -25
- package/proto/agoric/lien/lien.proto +0 -25
- package/x/lien/alias.go +0 -17
- package/x/lien/genesis.go +0 -58
- package/x/lien/genesis_test.go +0 -101
- package/x/lien/keeper/account.go +0 -285
- package/x/lien/keeper/keeper.go +0 -254
- package/x/lien/keeper/keeper_test.go +0 -623
- package/x/lien/lien.go +0 -203
- package/x/lien/lien_test.go +0 -529
- package/x/lien/module.go +0 -115
- package/x/lien/spec/01_concepts.md +0 -146
- package/x/lien/spec/02_messages.md +0 -96
- package/x/lien/types/accountkeeper.go +0 -81
- package/x/lien/types/accountstate.go +0 -27
- package/x/lien/types/expected_keepers.go +0 -18
- package/x/lien/types/genesis.pb.go +0 -567
- package/x/lien/types/key.go +0 -25
- package/x/lien/types/lien.pb.go +0 -403
- package/x/swingset/keeper/snapshotter.go +0 -491
- package/x/swingset/keeper/snapshotter_test.go +0 -185
- package/x/swingset/legacy/v32/params.go +0 -37
- package/x/swingset/legacy/v32/params_test.go +0 -133
- package/x/vibc/ibc.go +0 -442
- /package/{src/index.cjs → index.cjs} +0 -0
package/e2e_test/util.go
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
package e2etest
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"fmt"
|
|
6
|
+
"os"
|
|
7
|
+
"strconv"
|
|
8
|
+
"strings"
|
|
9
|
+
"testing"
|
|
10
|
+
|
|
11
|
+
"github.com/agoric-labs/interchaintest/v6"
|
|
12
|
+
"github.com/agoric-labs/interchaintest/v6/chain/cosmos"
|
|
13
|
+
"github.com/agoric-labs/interchaintest/v6/ibc"
|
|
14
|
+
"github.com/agoric-labs/interchaintest/v6/relayer"
|
|
15
|
+
"github.com/agoric-labs/interchaintest/v6/testutil"
|
|
16
|
+
|
|
17
|
+
"go.uber.org/zap/zaptest"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
const CHAIN_AGORIC = "agoric"
|
|
21
|
+
const CHAIN_GAIA = "gaia"
|
|
22
|
+
|
|
23
|
+
const RELAYER_COSMOS = "cosmos"
|
|
24
|
+
const RELAYER_HERMES = "hermes"
|
|
25
|
+
|
|
26
|
+
const DEFAULT_CHAINIMAGE_AGORIC = "agoric:heighliner-agoric"
|
|
27
|
+
const DEFAULT_BLOCKS_TO_WAIT = 25
|
|
28
|
+
|
|
29
|
+
const FMT_ENV_CHAINNAME = "E2ETEST_CHAINNAME%d"
|
|
30
|
+
const ENV_CHAINIMAGE_AGORIC = "E2ETEST_CHAINIMAGE_AGORIC"
|
|
31
|
+
const ENV_RELAYERNAME = "E2ETEST_RELAYERNAME"
|
|
32
|
+
const ENV_BLOCKS_TO_WAIT = "E2ETEST_BLOCKS_TO_WAIT"
|
|
33
|
+
|
|
34
|
+
// newHermesFactory creates a hermes relayer
|
|
35
|
+
func newHermesFactory(t *testing.T) interchaintest.RelayerFactory {
|
|
36
|
+
return interchaintest.NewBuiltinRelayerFactory(
|
|
37
|
+
ibc.Hermes,
|
|
38
|
+
zaptest.NewLogger(t),
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// newCosmosRlyFactory creates a cosmos relayer
|
|
43
|
+
func newCosmosRlyFactory(t *testing.T) interchaintest.RelayerFactory {
|
|
44
|
+
|
|
45
|
+
// TODO: At one point was using latest docker image for relyaer but disabling
|
|
46
|
+
// to remove variables while debugging heighliner builds of agoric chain are failing
|
|
47
|
+
//
|
|
48
|
+
IBCRelayerImage := "ghcr.io/cosmos/relayer"
|
|
49
|
+
IBCRelayerVersion := "latest"
|
|
50
|
+
image := relayer.CustomDockerImage(IBCRelayerImage, IBCRelayerVersion, "100:1000")
|
|
51
|
+
|
|
52
|
+
return interchaintest.NewBuiltinRelayerFactory(
|
|
53
|
+
ibc.CosmosRly,
|
|
54
|
+
zaptest.NewLogger(t),
|
|
55
|
+
image,
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// newCosmosHubChainSpec creates a chainspec for a gaia instance compatible with these tests
|
|
60
|
+
// TODO: replacing the v13.0.01 version with latest has not been tested.
|
|
61
|
+
func newCosmosHubChainSpec(chainUniqueName string, chainID string, numOfValidators int, numOfFullNodes int) *interchaintest.ChainSpec {
|
|
62
|
+
ret := &interchaintest.ChainSpec{
|
|
63
|
+
Name: "gaia",
|
|
64
|
+
ChainName: chainUniqueName,
|
|
65
|
+
Version: "v13.0.1", // This version of gaiad has the interface interchaintestv6 needs
|
|
66
|
+
NumValidators: &numOfValidators,
|
|
67
|
+
NumFullNodes: &numOfFullNodes,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ret.ChainConfig.ChainID = chainID
|
|
71
|
+
return ret
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// newUnknownCosmosChainSpec creates any cosmos chain where interchaintest has a built in definition
|
|
75
|
+
// NB: In many cases these images will not work due to issues outside the scope of Agoric's project
|
|
76
|
+
func newUnknownCosmosChainSpec(chain string, chainUniqueName string, chainID string, numOfValidators int, numOfFullNodes int) *interchaintest.ChainSpec {
|
|
77
|
+
ret := &interchaintest.ChainSpec{
|
|
78
|
+
Name: chain,
|
|
79
|
+
ChainName: chainUniqueName,
|
|
80
|
+
Version: "latest",
|
|
81
|
+
NumValidators: &numOfValidators,
|
|
82
|
+
NumFullNodes: &numOfFullNodes,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ret.ChainConfig.ChainID = chainID
|
|
86
|
+
return ret
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// newAgoricChainSpec fully specifies the details necessary to launch an Agoric chain image built from
|
|
90
|
+
// - https://github.com/strangelove-ventures/heighliner/pull/211
|
|
91
|
+
// - NoCrisisModule is a flag added in the agoric-labs fork of interchaintest
|
|
92
|
+
func newAgoricChainSpec(chainUniqueName string, chainID string, chainImage ibc.DockerImage, numOfValidators int, numOfFullNodes int) *interchaintest.ChainSpec {
|
|
93
|
+
coinDecimals := int64(6)
|
|
94
|
+
gasAdjustment := 1.3
|
|
95
|
+
noHostMount := false
|
|
96
|
+
|
|
97
|
+
return &interchaintest.ChainSpec{
|
|
98
|
+
Name: "agoric",
|
|
99
|
+
ChainName: chainUniqueName,
|
|
100
|
+
Version: chainImage.Version,
|
|
101
|
+
GasAdjustment: &gasAdjustment,
|
|
102
|
+
NoHostMount: &noHostMount,
|
|
103
|
+
ChainConfig: ibc.ChainConfig{
|
|
104
|
+
Type: "cosmos",
|
|
105
|
+
Name: "agoric",
|
|
106
|
+
ChainID: chainID,
|
|
107
|
+
Images: []ibc.DockerImage{
|
|
108
|
+
chainImage,
|
|
109
|
+
},
|
|
110
|
+
Bin: "agd",
|
|
111
|
+
Bech32Prefix: "agoric",
|
|
112
|
+
Denom: "ubld",
|
|
113
|
+
CoinType: "564",
|
|
114
|
+
// interchaintest is super flaky when gas is enabled
|
|
115
|
+
GasPrices: "0.0ubld",
|
|
116
|
+
GasAdjustment: 1.3,
|
|
117
|
+
TrustingPeriod: "672h",
|
|
118
|
+
NoHostMount: false,
|
|
119
|
+
NoCrisisModule: true,
|
|
120
|
+
SkipGenTx: false,
|
|
121
|
+
CoinDecimals: &coinDecimals,
|
|
122
|
+
},
|
|
123
|
+
NumValidators: &numOfValidators,
|
|
124
|
+
NumFullNodes: &numOfFullNodes,
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// getChainImage will build a docker image from the environment variable value
|
|
129
|
+
// E2ETEST_CHAINIMAGE_AGORIC. The value of this env var
|
|
130
|
+
// must be in the form "repo/image:version"
|
|
131
|
+
func getChainImageAgoric(t *testing.T) ibc.DockerImage {
|
|
132
|
+
ret := ibc.DockerImage{
|
|
133
|
+
UidGid: "1025:1025",
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
chainImage, present := os.LookupEnv(ENV_CHAINIMAGE_AGORIC)
|
|
137
|
+
if !present {
|
|
138
|
+
chainImage = DEFAULT_CHAINIMAGE_AGORIC
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
parts := strings.Split(chainImage, ":")
|
|
142
|
+
if len(parts) == 2 {
|
|
143
|
+
ret.Repository = parts[0]
|
|
144
|
+
ret.Version = parts[1]
|
|
145
|
+
} else {
|
|
146
|
+
t.Fatalf("Invalid value for %s[%s]. Must be of the format 'repository:version'", ENV_CHAINIMAGE_AGORIC, chainImage)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
t.Logf("ChainImages: %s[%s:%s]", ENV_CHAINIMAGE_AGORIC, ret.Repository, ret.Version)
|
|
150
|
+
|
|
151
|
+
return ret
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// getChainNames reads the environment variables FMT_ENV_CHAINNAME0, FMT_ENV_CHAINNAME1, FMT_ENV_CHAINNAME2, FMT_ENV_CHAINNAME3
|
|
155
|
+
func getChainNames(t *testing.T) [4]string {
|
|
156
|
+
|
|
157
|
+
ret := [4]string{
|
|
158
|
+
CHAIN_AGORIC, CHAIN_AGORIC, CHAIN_AGORIC, CHAIN_AGORIC,
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
for i := 0; i < 4; i++ {
|
|
162
|
+
envVar := fmt.Sprintf(FMT_ENV_CHAINNAME, i)
|
|
163
|
+
chainName, present := os.LookupEnv(envVar)
|
|
164
|
+
if present {
|
|
165
|
+
ret[i] = chainName
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
t.Logf("ChainNames: %s[%s] %s[%s] %s[%s] %s[%s]",
|
|
170
|
+
fmt.Sprintf(FMT_ENV_CHAINNAME, 0), ret[0],
|
|
171
|
+
fmt.Sprintf(FMT_ENV_CHAINNAME, 1), ret[1],
|
|
172
|
+
fmt.Sprintf(FMT_ENV_CHAINNAME, 2), ret[2],
|
|
173
|
+
fmt.Sprintf(FMT_ENV_CHAINNAME, 3), ret[3])
|
|
174
|
+
|
|
175
|
+
return ret
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// getChainSpec reads environment variables and builds a full ChainSpec
|
|
179
|
+
func getChainSpec(t *testing.T) []*interchaintest.ChainSpec {
|
|
180
|
+
nv := 1
|
|
181
|
+
nf := 0
|
|
182
|
+
|
|
183
|
+
chainNames := getChainNames(t)
|
|
184
|
+
chainImage := getChainImageAgoric(t)
|
|
185
|
+
|
|
186
|
+
ret := make([]*interchaintest.ChainSpec, 4)
|
|
187
|
+
|
|
188
|
+
for index, chainName := range chainNames {
|
|
189
|
+
chainId := fmt.Sprintf("%s%d", chainName, index)
|
|
190
|
+
chainUniqueName := chainId
|
|
191
|
+
|
|
192
|
+
switch chainName {
|
|
193
|
+
case CHAIN_AGORIC:
|
|
194
|
+
ret[index] = newAgoricChainSpec(chainUniqueName, chainId, chainImage, nv, nf)
|
|
195
|
+
case CHAIN_GAIA:
|
|
196
|
+
ret[index] = newCosmosHubChainSpec(chainUniqueName, chainId, nv, nf)
|
|
197
|
+
default:
|
|
198
|
+
ret[index] = newUnknownCosmosChainSpec(chainName, chainUniqueName, chainId, nv, nf)
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return ret
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// getRelayerFactory reads environment variables and builds the correct RelayerFactory
|
|
206
|
+
func getRelayerFactory(t *testing.T) interchaintest.RelayerFactory {
|
|
207
|
+
relayerName, present := os.LookupEnv(ENV_RELAYERNAME)
|
|
208
|
+
if !present {
|
|
209
|
+
relayerName = RELAYER_COSMOS
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var ret interchaintest.RelayerFactory
|
|
213
|
+
|
|
214
|
+
switch relayerName {
|
|
215
|
+
case RELAYER_COSMOS:
|
|
216
|
+
ret = newCosmosRlyFactory(t)
|
|
217
|
+
case RELAYER_HERMES:
|
|
218
|
+
ret = newHermesFactory(t)
|
|
219
|
+
default:
|
|
220
|
+
t.Fatalf("Invalid value for %s[%s]. Valid values are [%s] or [%s]", ENV_RELAYERNAME, relayerName, RELAYER_COSMOS, RELAYER_HERMES)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
t.Logf("RelayerNmae: %s[%s]", ENV_RELAYERNAME, relayerName)
|
|
224
|
+
|
|
225
|
+
return ret
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// sendIBCTransferWithWait performs cosmos.CosmosChain.SendIBCTransfer
|
|
229
|
+
// - Automatically waits to confirm TX is ACK'd
|
|
230
|
+
// - Automatically waits for results to settle
|
|
231
|
+
// - The environment variable E2ETEST_BLOCKS_TO_WAIT controls how many blocks to wait for ACK and settlement
|
|
232
|
+
func sendIBCTransferWithWait(
|
|
233
|
+
c *cosmos.CosmosChain,
|
|
234
|
+
ctx context.Context,
|
|
235
|
+
channelID string,
|
|
236
|
+
keyName string,
|
|
237
|
+
amount ibc.WalletAmount,
|
|
238
|
+
options ibc.TransferOptions,
|
|
239
|
+
) (tx ibc.Tx, err error) {
|
|
240
|
+
blocksToWait := DEFAULT_BLOCKS_TO_WAIT
|
|
241
|
+
|
|
242
|
+
blocksAsStr, present := os.LookupEnv(ENV_BLOCKS_TO_WAIT)
|
|
243
|
+
if present {
|
|
244
|
+
blocksToWait, err = strconv.Atoi(blocksAsStr)
|
|
245
|
+
if err != nil {
|
|
246
|
+
return tx, err
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
chainAHeight, err := c.Height(ctx)
|
|
251
|
+
if err != nil {
|
|
252
|
+
return tx, err
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
tx, err = c.SendIBCTransfer(ctx, channelID, keyName, amount, options)
|
|
256
|
+
if err != nil {
|
|
257
|
+
return tx, err
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
_, err = testutil.PollForAck(ctx, c, chainAHeight, chainAHeight+30, tx.Packet)
|
|
261
|
+
if err != nil {
|
|
262
|
+
return tx, err
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
err = testutil.WaitForBlocks(ctx, blocksToWait, c)
|
|
266
|
+
if err != nil {
|
|
267
|
+
return tx, err
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return tx, err
|
|
271
|
+
}
|
package/git-revision.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dabccdc
|
package/go.mod
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
module github.com/Agoric/agoric-sdk/golang/cosmos
|
|
2
|
+
|
|
3
|
+
go 1.20
|
|
4
|
+
|
|
5
|
+
require (
|
|
6
|
+
cosmossdk.io/errors v1.0.0-beta.7
|
|
7
|
+
cosmossdk.io/math v1.0.0-rc.0
|
|
8
|
+
github.com/armon/go-metrics v0.4.1
|
|
9
|
+
github.com/cosmos/cosmos-sdk v0.46.16
|
|
10
|
+
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2
|
|
11
|
+
github.com/cosmos/ibc-go/v6 v6.3.1
|
|
12
|
+
github.com/gogo/protobuf v1.3.3
|
|
13
|
+
github.com/golang/protobuf v1.5.3
|
|
14
|
+
github.com/gorilla/mux v1.8.0
|
|
15
|
+
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
|
16
|
+
github.com/pkg/errors v0.9.1
|
|
17
|
+
github.com/rakyll/statik v0.1.7
|
|
18
|
+
github.com/spf13/cast v1.5.0
|
|
19
|
+
github.com/spf13/cobra v1.7.0
|
|
20
|
+
github.com/spf13/viper v1.14.0
|
|
21
|
+
github.com/stretchr/testify v1.8.4
|
|
22
|
+
github.com/tendermint/tendermint v0.34.29
|
|
23
|
+
github.com/tendermint/tm-db v0.6.7
|
|
24
|
+
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98
|
|
25
|
+
google.golang.org/grpc v1.58.3
|
|
26
|
+
gopkg.in/yaml.v2 v2.4.0
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
require (
|
|
30
|
+
cloud.google.com/go v0.110.4 // indirect
|
|
31
|
+
cloud.google.com/go/compute v1.21.0 // indirect
|
|
32
|
+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
|
33
|
+
cloud.google.com/go/iam v1.1.1 // indirect
|
|
34
|
+
cloud.google.com/go/storage v1.30.1 // indirect
|
|
35
|
+
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
|
|
36
|
+
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
|
37
|
+
github.com/99designs/keyring v1.2.1 // indirect
|
|
38
|
+
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect
|
|
39
|
+
github.com/Workiva/go-datastructures v1.0.53 // indirect
|
|
40
|
+
github.com/aws/aws-sdk-go v1.44.122 // indirect
|
|
41
|
+
github.com/beorn7/perks v1.0.1 // indirect
|
|
42
|
+
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
|
|
43
|
+
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
|
|
44
|
+
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
|
|
45
|
+
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
|
|
46
|
+
github.com/cespare/xxhash v1.1.0 // indirect
|
|
47
|
+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
|
48
|
+
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
|
|
49
|
+
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
|
|
50
|
+
github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect
|
|
51
|
+
github.com/cometbft/cometbft-db v0.7.0 // indirect
|
|
52
|
+
github.com/confio/ics23/go v0.9.1 // indirect
|
|
53
|
+
github.com/cosmos/btcutil v1.0.5 // indirect
|
|
54
|
+
github.com/cosmos/cosmos-proto v1.0.0-beta.1 // indirect
|
|
55
|
+
github.com/cosmos/go-bip39 v1.0.0 // indirect
|
|
56
|
+
github.com/cosmos/gorocksdb v1.2.0 // indirect
|
|
57
|
+
github.com/cosmos/iavl v0.19.6 // indirect
|
|
58
|
+
github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect
|
|
59
|
+
github.com/creachadair/taskgroup v0.3.2 // indirect
|
|
60
|
+
github.com/danieljoos/wincred v1.1.2 // indirect
|
|
61
|
+
github.com/davecgh/go-spew v1.1.1 // indirect
|
|
62
|
+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
|
|
63
|
+
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
|
64
|
+
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
|
|
65
|
+
github.com/dgraph-io/ristretto v0.1.0 // indirect
|
|
66
|
+
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
|
67
|
+
github.com/dustin/go-humanize v1.0.0 // indirect
|
|
68
|
+
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
|
|
69
|
+
github.com/felixge/httpsnoop v1.0.2 // indirect
|
|
70
|
+
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
|
71
|
+
github.com/ghodss/yaml v1.0.0 // indirect
|
|
72
|
+
github.com/gin-gonic/gin v1.8.1 // indirect
|
|
73
|
+
github.com/go-kit/kit v0.12.0 // indirect
|
|
74
|
+
github.com/go-kit/log v0.2.1 // indirect
|
|
75
|
+
github.com/go-logfmt/logfmt v0.5.1 // indirect
|
|
76
|
+
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
|
|
77
|
+
github.com/gogo/gateway v1.1.0 // indirect
|
|
78
|
+
github.com/golang/glog v1.1.0 // indirect
|
|
79
|
+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
|
80
|
+
github.com/golang/snappy v0.0.4 // indirect
|
|
81
|
+
github.com/google/btree v1.1.2 // indirect
|
|
82
|
+
github.com/google/go-cmp v0.5.9 // indirect
|
|
83
|
+
github.com/google/orderedcode v0.0.1 // indirect
|
|
84
|
+
github.com/google/s2a-go v0.1.4 // indirect
|
|
85
|
+
github.com/google/uuid v1.3.0 // indirect
|
|
86
|
+
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
|
|
87
|
+
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
|
|
88
|
+
github.com/gorilla/handlers v1.5.1 // indirect
|
|
89
|
+
github.com/gorilla/websocket v1.5.0 // indirect
|
|
90
|
+
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
|
91
|
+
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
|
92
|
+
github.com/gtank/merlin v0.1.1 // indirect
|
|
93
|
+
github.com/gtank/ristretto255 v0.1.2 // indirect
|
|
94
|
+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
|
95
|
+
github.com/hashicorp/go-getter v1.6.1 // indirect
|
|
96
|
+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
|
97
|
+
github.com/hashicorp/go-safetemp v1.0.0 // indirect
|
|
98
|
+
github.com/hashicorp/go-version v1.6.0 // indirect
|
|
99
|
+
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
|
|
100
|
+
github.com/hashicorp/hcl v1.0.0 // indirect
|
|
101
|
+
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
|
|
102
|
+
github.com/iancoleman/orderedmap v0.2.0 // indirect
|
|
103
|
+
github.com/improbable-eng/grpc-web v0.15.0 // indirect
|
|
104
|
+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
|
105
|
+
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
|
106
|
+
github.com/jmhodges/levigo v1.0.0 // indirect
|
|
107
|
+
github.com/klauspost/compress v1.16.0 // indirect
|
|
108
|
+
github.com/lib/pq v1.10.7 // indirect
|
|
109
|
+
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
|
110
|
+
github.com/magiconair/properties v1.8.6 // indirect
|
|
111
|
+
github.com/manifoldco/promptui v0.9.0 // indirect
|
|
112
|
+
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
113
|
+
github.com/mattn/go-isatty v0.0.18 // indirect
|
|
114
|
+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
|
115
|
+
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
|
|
116
|
+
github.com/minio/highwayhash v1.0.2 // indirect
|
|
117
|
+
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
|
118
|
+
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
|
119
|
+
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
120
|
+
github.com/mtibben/percent v0.2.1 // indirect
|
|
121
|
+
github.com/pelletier/go-toml v1.9.5 // indirect
|
|
122
|
+
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
|
|
123
|
+
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
|
|
124
|
+
github.com/pmezard/go-difflib v1.0.0 // indirect
|
|
125
|
+
github.com/prometheus/client_golang v1.14.0 // indirect
|
|
126
|
+
github.com/prometheus/client_model v0.3.0 // indirect
|
|
127
|
+
github.com/prometheus/common v0.42.0 // indirect
|
|
128
|
+
github.com/prometheus/procfs v0.9.0 // indirect
|
|
129
|
+
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
|
130
|
+
github.com/regen-network/cosmos-proto v0.3.1 // indirect
|
|
131
|
+
github.com/rs/cors v1.8.2 // indirect
|
|
132
|
+
github.com/rs/zerolog v1.29.1 // indirect
|
|
133
|
+
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
|
134
|
+
github.com/spf13/afero v1.9.2 // indirect
|
|
135
|
+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
|
136
|
+
github.com/spf13/pflag v1.0.5 // indirect
|
|
137
|
+
github.com/subosito/gotenv v1.4.1 // indirect
|
|
138
|
+
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
|
139
|
+
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
|
|
140
|
+
github.com/tendermint/go-amino v0.16.0 // indirect
|
|
141
|
+
github.com/tidwall/btree v1.5.0 // indirect
|
|
142
|
+
github.com/ulikunitz/xz v0.5.10 // indirect
|
|
143
|
+
github.com/zondax/hid v0.9.2 // indirect
|
|
144
|
+
github.com/zondax/ledger-go v0.14.3 // indirect
|
|
145
|
+
go.etcd.io/bbolt v1.3.6 // indirect
|
|
146
|
+
go.opencensus.io v0.24.0 // indirect
|
|
147
|
+
golang.org/x/crypto v0.15.0 // indirect
|
|
148
|
+
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 // indirect
|
|
149
|
+
golang.org/x/net v0.18.0 // indirect
|
|
150
|
+
golang.org/x/oauth2 v0.10.0 // indirect
|
|
151
|
+
golang.org/x/sync v0.3.0 // indirect
|
|
152
|
+
golang.org/x/sys v0.14.0 // indirect
|
|
153
|
+
golang.org/x/term v0.14.0 // indirect
|
|
154
|
+
golang.org/x/text v0.14.0 // indirect
|
|
155
|
+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
|
156
|
+
google.golang.org/api v0.126.0 // indirect
|
|
157
|
+
google.golang.org/appengine v1.6.7 // indirect
|
|
158
|
+
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
|
|
159
|
+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
|
|
160
|
+
google.golang.org/protobuf v1.31.0 // indirect
|
|
161
|
+
gopkg.in/ini.v1 v1.67.0 // indirect
|
|
162
|
+
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
163
|
+
nhooyr.io/websocket v1.8.6 // indirect
|
|
164
|
+
sigs.k8s.io/yaml v1.3.0 // indirect
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
replace (
|
|
168
|
+
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
|
|
169
|
+
|
|
170
|
+
github.com/confio/ics23/go => github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1
|
|
171
|
+
|
|
172
|
+
// https://pkg.go.dev/vuln/GO-2023-2409
|
|
173
|
+
github.com/dvsekhvalnov/jose2go => github.com/dvsekhvalnov/jose2go v1.5.1-0.20231206184617-48ba0b76bc88
|
|
174
|
+
|
|
175
|
+
// Fix upstream GHSA-3vp4-m3rf-835h vulnerability.
|
|
176
|
+
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
|
|
177
|
+
|
|
178
|
+
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
|
|
179
|
+
|
|
180
|
+
// https://pkg.go.dev/vuln/GO-2023-1578
|
|
181
|
+
github.com/hashicorp/go-getter => github.com/hashicorp/go-getter v1.7.0
|
|
182
|
+
|
|
183
|
+
// replace broken goleveldb.
|
|
184
|
+
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
// Agoric-specific replacements:
|
|
188
|
+
replace (
|
|
189
|
+
// We need a fork of cosmos-sdk until all of the differences are merged.
|
|
190
|
+
github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.4
|
|
191
|
+
|
|
192
|
+
// Pick up an IAVL race fix.
|
|
193
|
+
github.com/cosmos/iavl => github.com/cosmos/iavl v0.19.7
|
|
194
|
+
|
|
195
|
+
// Use a version of ibc-go that is compatible with the above forks.
|
|
196
|
+
github.com/cosmos/ibc-go/v6 => github.com/agoric-labs/ibc-go/v6 v6.3.1-alpha.agoric.2
|
|
197
|
+
|
|
198
|
+
// use cometbft
|
|
199
|
+
// Use our fork at least until post-v0.34.14 is released with
|
|
200
|
+
// https://github.com/tendermint/tendermint/issue/6899 resolved.
|
|
201
|
+
github.com/tendermint/tendermint => github.com/agoric-labs/cometbft v0.34.30-alpha.agoric.1
|
|
202
|
+
|
|
203
|
+
// For testing against a local cosmos-sdk, ibc-go, or cometbft
|
|
204
|
+
// github.com/cosmos/cosmos-sdk => ../../../forks/cosmos-sdk
|
|
205
|
+
// github.com/cosmos/ibc-go/v6 => ../../../forks/ibc-go/v6
|
|
206
|
+
// github.com/tendermint/tendermint => ../../../forks/cometbft
|
|
207
|
+
)
|