Skip to content

Commit

Permalink
Merge pull request cosmos#432 from CosmWasm/wasmvm-0.14-alpha1
Browse files Browse the repository at this point in the history
Wasmvm 0.14 alpha2
  • Loading branch information
alpe authored Mar 4, 2021
2 parents 573bada + 8e466f0 commit 6bdac24
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/CosmWasm/wasmd
go 1.15

require (
github.com/CosmWasm/wasmvm v0.13.1-0.20210125204657-16df1fdaf712
github.com/CosmWasm/wasmvm v0.14.0-alpha2
github.com/cosmos/cosmos-sdk v0.41.4
github.com/cosmos/iavl v0.15.3
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQ
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmvm v0.13.1-0.20210125204657-16df1fdaf712 h1:8gMCeYi0In+3R+ox44SfXoY9a7KXngH8sDwsg+eLwB4=
github.com/CosmWasm/wasmvm v0.13.1-0.20210125204657-16df1fdaf712/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A=
github.com/CosmWasm/wasmvm v0.14.0-alpha1 h1:n6cKrufXvaAzDaUfw1wEr39hNBLv3BY2usUnShmAFwQ=
github.com/CosmWasm/wasmvm v0.14.0-alpha1/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A=
github.com/CosmWasm/wasmvm v0.14.0-alpha2 h1:IF+ZNYe6XxKmAZaAzX/Y2dXB1v3l+J0+Vyz69CtojOQ=
github.com/CosmWasm/wasmvm v0.14.0-alpha2/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/internal/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) {
wasmConfig := wasmTypes.DefaultWasmConfig()
pk := paramskeeper.NewKeeper(encodingConfig.Marshaler, encodingConfig.Amino, keyParams, tkeyParams)

srcKeeper := NewKeeper(encodingConfig.Marshaler, keyWasm, pk.Subspace(wasmTypes.DefaultParamspace), authkeeper.AccountKeeper{}, nil, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, tempDir, wasmConfig, "", nil, nil)
srcKeeper := NewKeeper(encodingConfig.Marshaler, keyWasm, pk.Subspace(wasmTypes.DefaultParamspace), authkeeper.AccountKeeper{}, nil, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, tempDir, wasmConfig, SupportedFeatures, nil, nil)
return &srcKeeper, ctx, []sdk.StoreKey{keyWasm, keyParams}
}

Expand Down
8 changes: 4 additions & 4 deletions x/wasm/internal/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func TestInstantiate(t *testing.T) {

gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
require.Equal(t, uint64(0x118c2), gasAfter-gasBefore)
require.Equal(t, uint64(0x118c0), gasAfter-gasBefore)
}

// ensure it is stored properly
Expand Down Expand Up @@ -441,8 +441,8 @@ func TestInstantiateWithContractDataResponse(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil)

wasmerMock := &wasmtesting.MockWasmer{
InstantiateFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.InitResponse, uint64, error) {
return &wasmvmtypes.InitResponse{Data: []byte("my-response-data")}, 0, nil
InstantiateFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
return &wasmvmtypes.Response{Data: []byte("my-response-data")}, 0, nil
},
AnalyzeCodeFn: wasmtesting.WithoutIBCAnalyzeFn,
CreateFn: wasmtesting.NoOpCreateFn,
Expand Down Expand Up @@ -515,7 +515,7 @@ func TestExecute(t *testing.T) {
// make sure gas is properly deducted from ctx
gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
require.Equal(t, uint64(0x11d3f), gasAfter-gasBefore)
require.Equal(t, uint64(0x11d39), gasAfter-gasBefore)
}
// ensure bob now exists and got both payments released
bobAcct = accKeeper.GetAccount(ctx, bob)
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/internal/keeper/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestConstructorOptions(t *testing.T) {
nil,
"tempDir",
types.DefaultWasmConfig(),
"",
SupportedFeatures,
nil,
nil,
spec.srcOpt,
Expand Down
18 changes: 9 additions & 9 deletions x/wasm/internal/keeper/recurse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ func initRecurseContract(t *testing.T) (contract sdk.AccAddress, creator sdk.Acc

func TestGasCostOnQuery(t *testing.T) {
const (
GasNoWork uint64 = 43_084
GasNoWork uint64 = 43_074
// Note: about 100 SDK gas (10k wasmer gas) for each round of sha256
GasWork50 uint64 = 48_711 // this is a little shy of 50k gas - to keep an eye on the limit
GasWork50 uint64 = 48_744 // this is a little shy of 50k gas - to keep an eye on the limit

GasReturnUnhashed uint64 = 295
GasReturnHashed uint64 = 270
GasReturnUnhashed uint64 = 287
GasReturnHashed uint64 = 262
)

cases := map[string]struct {
Expand All @@ -80,7 +80,7 @@ func TestGasCostOnQuery(t *testing.T) {
msg: Recurse{
Work: 50, // 50 rounds of sha256 inside the contract
},
expectedGas: GasWork50,
expectedGas: GasWork50 + 1,
},
"recursion 1, no work": {
gasLimit: 400_000,
Expand Down Expand Up @@ -224,9 +224,9 @@ func TestLimitRecursiveQueryGas(t *testing.T) {

const (
// Note: about 100 SDK gas (10k wasmer gas) for each round of sha256
GasWork2k uint64 = 270_359 // = InstanceCost + x // we have 6x gas used in cpu than in the instance
GasWork2k uint64 = 271_797 // = InstanceCost + x // we have 6x gas used in cpu than in the instance
// This is overhead for calling into a sub-contract
GasReturnHashed uint64 = 276
GasReturnHashed uint64 = 265
)

cases := map[string]struct {
Expand All @@ -252,8 +252,8 @@ func TestLimitRecursiveQueryGas(t *testing.T) {
Work: 2000,
},
expectQueriesFromContract: 5,
// FIXME: why -3... confused a bit by calculations, seems like rounding issues
expectedGas: GasWork2k + 5*(GasWork2k+GasReturnHashed) - 3,
// FIXME: why +1 ... confused a bit by calculations, seems like rounding issues
expectedGas: GasWork2k + 5*(GasWork2k+GasReturnHashed) + 1,
},
// this is where we expect an error...
// it has enough gas to run 4 times and die on the 5th (4th time dispatching to sub-contract)
Expand Down
Binary file modified x/wasm/internal/keeper/testdata/burner.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion x/wasm/internal/keeper/testdata/download_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

tag="$1"

for contract in burner hackatom reflect staking; do
for contract in burner hackatom ibc_reflect ibc_reflect_send reflect staking; do
url="https://github.com/CosmWasm/cosmwasm/releases/download/$tag/${contract}.wasm"
echo "Downloading $url ..."
wget -O "${contract}.wasm" "$url"
Expand Down
Binary file modified x/wasm/internal/keeper/testdata/hackatom.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/hackatom.wasm.gzip
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/ibc_reflect.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/ibc_reflect_send.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/reflect.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/staking.wasm
Binary file not shown.
26 changes: 13 additions & 13 deletions x/wasm/internal/keeper/wasmtesting/mock_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ var _ types.WasmerEngine = &MockWasmer{}
type MockWasmer struct {
CreateFn func(codeID wasmvm.WasmCode) (wasmvm.Checksum, error)
AnalyzeCodeFn func(codeID wasmvm.Checksum) (*wasmvmtypes.AnalysisReport, error)
InstantiateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.InitResponse, uint64, error)
ExecuteFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.HandleResponse, uint64, error)
InstantiateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error)
ExecuteFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error)
QueryFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, queryMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) ([]byte, uint64, error)
MigrateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.MigrateResponse, uint64, error)
MigrateFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error)
GetCodeFn func(codeID wasmvm.Checksum) (wasmvm.WasmCode, error)
CleanupFn func()
IBCChannelOpenFn func(codeID wasmvm.Checksum, env wasmvmtypes.Env, channel wasmvmtypes.IBCChannel, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (uint64, error)
Expand Down Expand Up @@ -87,14 +87,14 @@ func (m *MockWasmer) AnalyzeCode(codeID wasmvm.Checksum) (*wasmvmtypes.AnalysisR
return m.AnalyzeCodeFn(codeID)
}

func (m *MockWasmer) Instantiate(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.InitResponse, uint64, error) {
func (m *MockWasmer) Instantiate(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
if m.InstantiateFn == nil {
panic("not supposed to be called!")
}
return m.InstantiateFn(codeID, env, info, initMsg, store, goapi, querier, gasMeter, gasLimit)
}

func (m *MockWasmer) Execute(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.HandleResponse, uint64, error) {
func (m *MockWasmer) Execute(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
if m.ExecuteFn == nil {
panic("not supposed to be called!")
}
Expand All @@ -108,7 +108,7 @@ func (m *MockWasmer) Query(codeID wasmvm.Checksum, env wasmvmtypes.Env, queryMsg
return m.QueryFn(codeID, env, queryMsg, store, goapi, querier, gasMeter, gasLimit)
}

func (m *MockWasmer) Migrate(codeID wasmvm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.MigrateResponse, uint64, error) {
func (m *MockWasmer) Migrate(codeID wasmvm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
if m.MigrateFn == nil {
panic("not supposed to be called!")
}
Expand Down Expand Up @@ -139,17 +139,17 @@ func SelfCallingInstMockWasmer(executeCalled *bool) *MockWasmer {
anyCodeID := bytes.Repeat([]byte{0x1}, 32)
return anyCodeID, nil
},
InstantiateFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.InitResponse, uint64, error) {
return &wasmvmtypes.InitResponse{
InstantiateFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
return &wasmvmtypes.Response{
Messages: []wasmvmtypes.CosmosMsg{
{Wasm: &wasmvmtypes.WasmMsg{Execute: &wasmvmtypes.ExecuteMsg{ContractAddr: env.Contract.Address, Msg: []byte(`{}`)}}},
},
}, 1, nil
},
AnalyzeCodeFn: WithoutIBCAnalyzeFn,
ExecuteFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.HandleResponse, uint64, error) {
ExecuteFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
*executeCalled = true
return &wasmvmtypes.HandleResponse{}, 1, nil
return &wasmvmtypes.Response{}, 1, nil
},
}
}
Expand Down Expand Up @@ -235,7 +235,7 @@ type contractExecutable interface {
querier wasmvm.Querier,
gasMeter wasmvm.GasMeter,
gasLimit uint64,
) (*wasmvmtypes.HandleResponse, uint64, error)
) (*wasmvmtypes.Response, uint64, error)
}

//MakeIBCInstantiable adds some noop functions to not fail when contract is used for instantiation
Expand Down Expand Up @@ -273,8 +273,8 @@ func HashOnlyCreateFn(code wasmvm.WasmCode) (wasmvm.Checksum, error) {
return hash[:], nil
}

func NoOpInstantiateFn(wasmvm.Checksum, wasmvmtypes.Env, wasmvmtypes.MessageInfo, []byte, wasmvm.KVStore, wasmvm.GoAPI, wasmvm.Querier, wasmvm.GasMeter, uint64) (*wasmvmtypes.InitResponse, uint64, error) {
return &wasmvmtypes.InitResponse{}, 0, nil
func NoOpInstantiateFn(wasmvm.Checksum, wasmvmtypes.Env, wasmvmtypes.MessageInfo, []byte, wasmvm.KVStore, wasmvm.GoAPI, wasmvm.Querier, wasmvm.GasMeter, uint64) (*wasmvmtypes.Response, uint64, error) {
return &wasmvmtypes.Response{}, 0, nil
}

func NoOpCreateFn(_ wasmvm.WasmCode) (wasmvm.Checksum, error) {
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/internal/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ func NewEnv(ctx sdk.Context, contractAddr sdk.AccAddress) wasmvmtypes.Env {
// NewInfo initializes the MessageInfo for a contract instance
func NewInfo(creator sdk.AccAddress, deposit sdk.Coins) wasmvmtypes.MessageInfo {
return wasmvmtypes.MessageInfo{
Sender: creator.String(),
SentFunds: NewWasmCoins(deposit),
Sender: creator.String(),
Funds: NewWasmCoins(deposit),
}
}

Expand Down
6 changes: 3 additions & 3 deletions x/wasm/internal/types/wasmer_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type WasmerEngine interface {
querier wasmvm.Querier,
gasMeter wasmvm.GasMeter,
gasLimit uint64,
) (*wasmvmtypes.InitResponse, uint64, error)
) (*wasmvmtypes.Response, uint64, error)

// Execute calls a given contract. Since the only difference between contracts with the same CodeID is the
// data in their local storage, and their address in the outside world, we need no ContractID here.
Expand All @@ -58,7 +58,7 @@ type WasmerEngine interface {
querier wasmvm.Querier,
gasMeter wasmvm.GasMeter,
gasLimit uint64,
) (*wasmvmtypes.HandleResponse, uint64, error)
) (*wasmvmtypes.Response, uint64, error)

// Query allows a client to execute a contract-specific query. If the result is not empty, it should be
// valid json-encoded data to return to the client.
Expand Down Expand Up @@ -89,7 +89,7 @@ type WasmerEngine interface {
querier wasmvm.Querier,
gasMeter wasmvm.GasMeter,
gasLimit uint64,
) (*wasmvmtypes.MigrateResponse, uint64, error)
) (*wasmvmtypes.Response, uint64, error)

// GetCode will load the original wasm code for the given code id.
// This will only succeed if that code id was previously returned from
Expand Down
6 changes: 3 additions & 3 deletions x/wasm/relay_pingpong_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ type player struct {

// Execute starts the ping pong game
// Contracts finds all connected channels and broadcasts a ping message
func (p *player) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.HandleResponse, uint64, error) {
func (p *player) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
p.execCalls++
if p.execCalls%2 == 1 { // skip checkTx step because of no rollback with `chain.GetContext()`
return &wasmvmtypes.HandleResponse{}, 0, nil
return &wasmvmtypes.Response{}, 0, nil
}
// start game
var start startGame
Expand All @@ -164,7 +164,7 @@ func (p *player) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmt

p.incrementCounter(sentBallsCountKey, store)
store.Set(lastBallSentKey, sdk.Uint64ToBigEndian(start.Value))
return &wasmvmtypes.HandleResponse{
return &wasmvmtypes.Response{
Messages: []wasmvmtypes.CosmosMsg{
{
IBC: &wasmvmtypes.IBCMsg{
Expand Down
8 changes: 4 additions & 4 deletions x/wasm/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ type sendViaIBCTransferContract struct {
t *testing.T
}

func (s *sendViaIBCTransferContract) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.HandleResponse, uint64, error) {
func (s *sendViaIBCTransferContract) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
var in startTransfer
if err := json.Unmarshal(executeMsg, &in); err != nil {
return nil, 0, err
Expand All @@ -332,7 +332,7 @@ func (s *sendViaIBCTransferContract) Execute(code wasmvm.Checksum, env wasmvmtyp
},
}

return &wasmvmtypes.HandleResponse{Messages: []wasmvmtypes.CosmosMsg{{IBC: ibcMsg}}}, 0, nil
return &wasmvmtypes.Response{Messages: []wasmvmtypes.CosmosMsg{{IBC: ibcMsg}}}, 0, nil
}

var _ wasmtesting.IBCContractCallbacks = &sendEmulatedIBCTransferContract{}
Expand All @@ -345,7 +345,7 @@ type sendEmulatedIBCTransferContract struct {
contractAddr string
}

func (s *sendEmulatedIBCTransferContract) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.HandleResponse, uint64, error) {
func (s *sendEmulatedIBCTransferContract) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.Response, uint64, error) {
var in startTransfer
if err := json.Unmarshal(executeMsg, &in); err != nil {
return nil, 0, err
Expand All @@ -365,7 +365,7 @@ func (s *sendEmulatedIBCTransferContract) Execute(code wasmvm.Checksum, env wasm
TimeoutTimestamp: &in.Timeout,
},
}
return &wasmvmtypes.HandleResponse{Messages: []wasmvmtypes.CosmosMsg{{IBC: ibcMsg}}}, 0, nil
return &wasmvmtypes.Response{Messages: []wasmvmtypes.CosmosMsg{{IBC: ibcMsg}}}, 0, nil
}

func (c *sendEmulatedIBCTransferContract) IBCPacketTimeout(codeID wasmvm.Checksum, env wasmvmtypes.Env, packet wasmvmtypes.IBCPacket, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64) (*wasmvmtypes.IBCBasicResponse, uint64, error) {
Expand Down

0 comments on commit 6bdac24

Please sign in to comment.