Skip to content

Commit

Permalink
imp: increased gas for ExecCreateChannel
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Oct 28, 2023
1 parent 40aa99a commit 609416a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions e2e/interchaintest/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (s *ContractTestSuite) TestIcaContractInstantiatedChannelHandshake() {
// Instantiate the contract with channel:
instantiateMsg := types.NewInstantiateMsgWithChannelInitOptions(nil, s.ChainAConnID, s.ChainBConnID, nil, nil)

contractAddr, err := wasmd.InstantiateContract(ctx, wasmdUser.KeyName(), codeId, instantiateMsg, true, "--gas", "1000000")
contractAddr, err := wasmd.InstantiateContract(ctx, wasmdUser.KeyName(), codeId, instantiateMsg, true, "--gas", "500000")
s.Require().NoError(err)

s.Contract = types.NewContract(contractAddr, codeId, wasmd)
Expand Down Expand Up @@ -221,7 +221,7 @@ func (s *ContractTestSuite) TestRecoveredIcaContractInstantiatedChannelHandshake
// Instantiate the contract with channel:
instantiateMsg := types.NewInstantiateMsgWithChannelInitOptions(nil, "invalid", s.ChainBConnID, nil, nil)

_, err = wasmd.InstantiateContract(ctx, wasmdUser.KeyName(), codeId, instantiateMsg, true, "--gas", "2000000")
_, err = wasmd.InstantiateContract(ctx, wasmdUser.KeyName(), codeId, instantiateMsg, true, "--gas", "500000")
s.Require().ErrorContains(err, "submessages: invalid connection hop ID")
})

Expand All @@ -231,14 +231,14 @@ func (s *ContractTestSuite) TestRecoveredIcaContractInstantiatedChannelHandshake

// unfortunately, this doesn't error out because the connection id is in the counterparty.
// instead, the handshake never completes. A new channel may be created by the relayer.
contractAddr, err := wasmd.InstantiateContract(ctx, wasmdUser.KeyName(), codeId, instantiateMsg, true, "--gas", "2000000")
contractAddr, err := wasmd.InstantiateContract(ctx, wasmdUser.KeyName(), codeId, instantiateMsg, true, "--gas", "500000")
s.Require().NoError(err)

s.Contract = types.NewContract(contractAddr, codeId, wasmd)
})

s.Run("TestChannelHandshakeSuccessAfterFail", func() {
err = s.Contract.ExecCreateChannel(ctx, wasmdUser.KeyName(), s.ChainAConnID, s.ChainBConnID, nil, nil)
err = s.Contract.ExecCreateChannel(ctx, wasmdUser.KeyName(), s.ChainAConnID, s.ChainBConnID, nil, nil, "--gas", "500000")
s.Require().NoError(err)

// Wait for the channel to get set up
Expand Down
9 changes: 5 additions & 4 deletions e2e/interchaintest/types/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ func (c *Contract) Port() string {

func (c *Contract) ExecCreateChannel(
ctx context.Context, callerKeyName string, connectionId string,
counterpartyConnectionId string, counterpartyPortId *string, txEncoding *string,
counterpartyConnectionId string, counterpartyPortId *string,
txEncoding *string, extraExecTxArgs ...string,
) error {
msg := NewCreateChannelMsg(connectionId, counterpartyConnectionId, counterpartyPortId, txEncoding)
err := c.Execute(ctx, callerKeyName, msg)
err := c.Execute(ctx, callerKeyName, msg, extraExecTxArgs...)
return err
}

Expand All @@ -72,8 +73,8 @@ func (c *Contract) ExecPredefinedAction(ctx context.Context, callerKeyName strin
return err
}

func (c *Contract) Execute(ctx context.Context, callerKeyName string, execMsg string) error {
_, err := c.chain.ExecuteContract(ctx, callerKeyName, c.Address, execMsg)
func (c *Contract) Execute(ctx context.Context, callerKeyName string, execMsg string, extraExecTxArgs ...string) error {
_, err := c.chain.ExecuteContract(ctx, callerKeyName, c.Address, execMsg, extraExecTxArgs...)
return err
}

Expand Down

0 comments on commit 609416a

Please sign in to comment.