Upgrade to cosmos-sdk v0.45.0 (#717)

* Upgrade to cosmos-sdk v0.44.5

* Upgrade to sdk v0.45.0-rc1

* Fix local test deploy scripts

* Bump to v0.45.0 final release

* Fixed replace to 0.45.0 not rc1

* Fix changed import path since rc1

Co-authored-by: Ethan Frey <ethanfrey@users.noreply.github.com>
This commit is contained in:
Alexander Peters
2022-01-20 12:47:01 +01:00
committed by GitHub
parent 52477ead36
commit b8319aa334
134 changed files with 4249 additions and 4559 deletions

View File

@@ -3,13 +3,15 @@ package wasm_test
import (
"testing"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"
ibcexported "github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
"github.com/stretchr/testify/assert"
channeltypes "github.com/cosmos/ibc-go/v2/modules/core/04-channel/types"
ibctesting "github.com/cosmos/ibc-go/v2/testing"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
"github.com/stretchr/testify/require"
"github.com/CosmWasm/wasmd/x/wasm/ibctesting"
wasmibctesting "github.com/CosmWasm/wasmd/x/wasm/ibctesting"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
)
@@ -22,9 +24,9 @@ func TestIBCReflectContract(t *testing.T) {
// "ibc_reflect" sends a submessage to "reflect" which is returned as submessage.
var (
coordinator = ibctesting.NewCoordinator(t, 2, nil, nil)
chainA = coordinator.GetChain(ibctesting.GetChainID(0))
chainB = coordinator.GetChain(ibctesting.GetChainID(1))
coordinator = wasmibctesting.NewCoordinator(t, 2)
chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
)
coordinator.CommitBlock(chainA, chainB)
@@ -43,11 +45,24 @@ func TestIBCReflectContract(t *testing.T) {
sourcePortID = chainA.ContractInfo(sendContractAddr).IBCPortID
counterpartPortID = chainB.ContractInfo(reflectContractAddr).IBCPortID
)
clientA, clientB, connA, connB := coordinator.SetupClientConnections(chainA, chainB, ibcexported.Tendermint)
connA.NextChannelVersion = "ibc-reflect-v1"
connB.NextChannelVersion = "ibc-reflect-v1"
// flip instantiation so that we do not run into https://github.com/cosmos/cosmos-sdk/issues/8334
channelA, channelB := coordinator.CreateChannel(chainA, chainB, connA, connB, sourcePortID, counterpartPortID, channeltypes.ORDERED)
coordinator.CommitBlock(chainA, chainB)
coordinator.UpdateTime()
require.Equal(t, chainA.CurrentHeader.Time, chainB.CurrentHeader.Time)
path := wasmibctesting.NewPath(chainA, chainB)
path.EndpointA.ChannelConfig = &ibctesting.ChannelConfig{
PortID: sourcePortID,
Version: "ibc-reflect-v1",
Order: channeltypes.ORDERED,
}
path.EndpointB.ChannelConfig = &ibctesting.ChannelConfig{
PortID: counterpartPortID,
Version: "ibc-reflect-v1",
Order: channeltypes.ORDERED,
}
coordinator.SetupConnections(path)
coordinator.CreateChannels(path)
// TODO: query both contracts directly to ensure they have registered the proper connection
// (and the chainB has created a reflect contract)
@@ -69,13 +84,13 @@ func TestIBCReflectContract(t *testing.T) {
// ensure the expected packet was prepared, and relay it
require.Equal(t, 1, len(chainA.PendingSendPackets))
require.Equal(t, 0, len(chainB.PendingSendPackets))
err := coordinator.RelayAndAckPendingPackets(chainA, chainB, clientA, clientB)
err := coordinator.RelayAndAckPendingPackets(path)
require.NoError(t, err)
require.Equal(t, 0, len(chainA.PendingSendPackets))
require.Equal(t, 0, len(chainB.PendingSendPackets))
// let's query the source contract and make sure it registered an address
query := ReflectSendQueryMsg{Account: &AccountQuery{ChannelID: channelA.ID}}
query := ReflectSendQueryMsg{Account: &AccountQuery{ChannelID: path.EndpointA.ChannelID}}
var account AccountResponse
err = chainA.SmartQuery(sendContractAddr.String(), query, &account)
require.NoError(t, err)
@@ -83,15 +98,13 @@ func TestIBCReflectContract(t *testing.T) {
require.Empty(t, account.RemoteBalance)
// close channel
coordinator.CloseChannel(chainA, chainB, channelA, channelB)
coordinator.CloseChannel(path)
// let's query the source contract and make sure it registered an address
account = AccountResponse{}
err = chainA.SmartQuery(sendContractAddr.String(), query, &account)
require.Error(t, err)
assert.Contains(t, err.Error(), "not found")
_ = clientB
}
type ReflectSendQueryMsg struct {