Skip to content

Commit d2ab8dc

Browse files
committed
fix issues
1 parent 8a21358 commit d2ab8dc

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

tests/e2e/chain.go

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import (
3333
gaia "github.com/cosmos/gaia/v23/app"
3434
gaiaparams "github.com/cosmos/gaia/v23/app/params"
3535
metaprotocoltypes "github.com/cosmos/gaia/v23/x/metaprotocols/types"
36+
37+
wasmclienttypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
3638
)
3739

3840
const (
@@ -64,6 +66,7 @@ func init() {
6466
providertypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
6567
metaprotocoltypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
6668
ratelimittypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
69+
wasmclienttypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
6770

6871
cdc = encodingConfig.Marshaler
6972
txConfig = encodingConfig.TxConfig

tests/e2e/e2e_exec_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g
370370

371371
generalFlags := []string{
372372
fmt.Sprintf("--%s=%s", flags.FlagFrom, submitterAddr),
373-
fmt.Sprintf("--%s=%s", flags.FlagGas, "400000"), // default 200000 isn't enough
373+
fmt.Sprintf("--%s=%s", flags.FlagGas, "50000000"), // default 200000 isn't enough
374374
fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees),
375375
fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id),
376376
"--keyring-backend=test",

tests/e2e/e2e_wasm_light_client_test.go

+20-19
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ import (
77
"strconv"
88
"time"
99

10+
"github.com/cosmos/cosmos-sdk/client/flags"
1011
"github.com/cosmos/gaia/v23/tests/e2e/data"
1112
)
1213

1314
const (
14-
proposalStoreWasmLightClientFilename = "proposal_store_wasm_light_client.json"
15-
wasmLightClientStateFilename = "wasm_light_client_state.json"
16-
wasmLightClientConsensusStateFilename = "wasm_light_client_consensus_state.json"
15+
proposalStoreWasmLightClientFilename = "proposal_store_wasm_light_client.json"
1716
)
1817

1918
func (s *IntegrationTestSuite) testStoreWasmLightClient() {
@@ -39,7 +38,7 @@ func (s *IntegrationTestSuite) testStoreWasmLightClient() {
3938
res, err := queryIbcWasmChecksums(chainEndpoint)
4039
s.Require().NoError(err)
4140
s.Require().NotNil(res)
42-
s.Require().Equal(len(res), 1)
41+
s.Require().Equal(1, len(res))
4342

4443
return true
4544
},
@@ -52,20 +51,33 @@ func (s *IntegrationTestSuite) testCreateWasmLightClient() {
5251
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
5352
defer cancel()
5453

55-
s.writeClientAndConsensusState(s.chainA)
54+
valIdx := 0
55+
val := s.chainA.validators[valIdx]
56+
address, _ := val.keyInfo.GetAddress()
57+
sender := address.String()
58+
59+
clientState := `{"@type":"/ibc.lightclients.wasm.v1.ClientState","data":"ZG9lc250IG1hdHRlcg==","checksum":"O45STPnbLLar4DtFwDx0dE6tuXQW5XTKPHpbjaugun4=","latest_height":{"revision_number":"0","revision_height":"7795583"}}`
60+
consensusState := `{"@type":"/ibc.lightclients.wasm.v1.ConsensusState","data":"ZG9lc250IG1hdHRlcg=="}`
5661

5762
cmd := []string{
5863
gaiadBinary,
5964
txCommand,
6065
"ibc",
6166
"client",
6267
"create",
63-
wasmLightClientStateFilename,
64-
wasmLightClientConsensusStateFilename,
68+
clientState,
69+
consensusState,
70+
fmt.Sprintf("--from=%s", sender),
71+
fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()),
72+
fmt.Sprintf("--%s=%s", flags.FlagChainID, s.chainA.id),
73+
"--keyring-backend=test",
74+
"--broadcast-mode=sync",
75+
"--output=json",
76+
"-y",
6577
}
6678

6779
s.T().Logf("Creating wasm light client on chain %s", s.chainA.id)
68-
s.executeGaiaTxCommand(ctx, s.chainA, cmd, 0, s.defaultExecValidation(s.chainA, 0))
80+
s.executeGaiaTxCommand(ctx, s.chainA, cmd, valIdx, s.defaultExecValidation(s.chainA, valIdx))
6981
s.T().Log("successfully created wasm light client")
7082
}
7183

@@ -92,14 +104,3 @@ func (s *IntegrationTestSuite) writeStoreWasmLightClientProposal(c *chain) {
92104
err := writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalStoreWasmLightClientFilename), []byte(propMsgBody))
93105
s.Require().NoError(err)
94106
}
95-
96-
func (s *IntegrationTestSuite) writeClientAndConsensusState(c *chain) {
97-
clientState := `{"@type":"/ibc.lightclients.wasm.v1.ClientState","data":"ZG9lc250IG1hdHRlcg==","checksum":"O45STPnbLLar4DtFwDx0dE6tuXQW5XTKPHpbjaugun4=","latest_height":{"revision_number":"0","revision_height":"7795583"}}`
98-
consensusState := `{"@type":"/ibc.lightclients.wasm.v1.ConsensusState","data":"ZG9lc250IG1hdHRlcg=="}`
99-
100-
err := writeFile(filepath.Join(c.validators[0].configDir(), "config", wasmLightClientStateFilename), []byte(clientState))
101-
s.Require().NoError(err)
102-
103-
err = writeFile(filepath.Join(c.validators[0].configDir(), "config", wasmLightClientConsensusStateFilename), []byte(consensusState))
104-
s.Require().NoError(err)
105-
}

0 commit comments

Comments
 (0)