Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade ibc-go to v8 and upgrade ict to sdk v0.50.0-beta.0 #674

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20'

- name: checkout interchaintest
uses: actions/checkout@v3
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20'
cache: false

- name: checkout interchaintest
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20'
cache: false

- name: checkout interchaintest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: '1.20'

- name: checkout interchaintest
uses: actions/checkout@v3

# run tests
- name: run unit tests
# -short flag purposefully omitted because there are some longer unit tests
run: go test -race -timeout 10m -failfast -p 2 $(go list ./... | grep -v /cmd | grep -v /examples)
run: go test -race -timeout 10m -failfast -p 2 $(go list ./... | grep -v /cmd | grep -v /examples)
25 changes: 13 additions & 12 deletions chain/cosmos/08-wasm-types/client_state.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package types

import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
Expand All @@ -21,11 +22,11 @@ func (c ClientState) Validate() error {
return nil
}

func (c ClientState) Status(ctx sdk.Context, store sdk.KVStore, cdc codec.BinaryCodec) exported.Status {
func (c ClientState) Status(ctx sdk.Context, store storetypes.KVStore, cdc codec.BinaryCodec) exported.Status {
return exported.Active
}

func (c ClientState) ExportMetadata(store sdk.KVStore) []exported.GenesisMetadata {
func (c ClientState) ExportMetadata(store storetypes.KVStore) []exported.GenesisMetadata {
return []exported.GenesisMetadata{}
}

Expand All @@ -35,20 +36,20 @@ func (c ClientState) ZeroCustomFields() exported.ClientState {

func (c ClientState) GetTimestampAtHeight(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
) (uint64, error) {
return 0, nil
}

func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store sdk.KVStore, state exported.ConsensusState) error {
func (c ClientState) Initialize(context sdk.Context, marshaler codec.BinaryCodec, store storetypes.KVStore, state exported.ConsensusState) error {
return nil
}

func (c ClientState) VerifyMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
Expand All @@ -62,7 +63,7 @@ func (c ClientState) VerifyMembership(

func (c ClientState) VerifyNonMembership(
ctx sdk.Context,
clientStore sdk.KVStore,
clientStore storetypes.KVStore,
cdc codec.BinaryCodec,
height exported.Height,
delayTimePeriod uint64,
Expand All @@ -77,34 +78,34 @@ func (c ClientState) VerifyNonMembership(
// It must handle each type of ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState, and UpdateStateOnMisbehaviour
// will assume that the content of the ClientMessage has been verified and can be trusted. An error should be returned
// if the ClientMessage fails to verify.
func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) error {
func (c ClientState) VerifyClientMessage(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) error {
return nil
}

func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, msg exported.ClientMessage) bool {
func (c ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, msg exported.ClientMessage) bool {
return true
}

// UpdateStateOnMisbehaviour should perform appropriate state changes on a client state given that misbehaviour has been detected and verified
func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) {
func (c ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) {

}

func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, clientMsg exported.ClientMessage) []exported.Height {
func (c ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height {
return []exported.Height{c.LatestHeight}
}

func (c ClientState) CheckSubstituteAndUpdateState(
ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore,
substituteClientStore sdk.KVStore, substituteClient exported.ClientState,
substituteClientStore storetypes.KVStore, substituteClient exported.ClientState,
) error {
return nil
}

func (c ClientState) VerifyUpgradeAndUpdateState(
ctx sdk.Context,
cdc codec.BinaryCodec,
store sdk.KVStore,
store storetypes.KVStore,
newClient exported.ClientState,
newConsState exported.ConsensusState,
proofUpgradeClient,
Expand Down
40 changes: 0 additions & 40 deletions chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,46 +417,6 @@ func (tn *ChainNode) FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx,
}
txs = append(txs, newTx)
}
if len(blockRes.BeginBlockEvents) > 0 {
beginBlockTx := blockdb.Tx{
Data: []byte(`{"data":"begin_block","note":"this is a transaction artificially created for debugging purposes"}`),
}
beginBlockTx.Events = make([]blockdb.Event, len(blockRes.BeginBlockEvents))
for i, e := range blockRes.BeginBlockEvents {
attrs := make([]blockdb.EventAttribute, len(e.Attributes))
for j, attr := range e.Attributes {
attrs[j] = blockdb.EventAttribute{
Key: string(attr.Key),
Value: string(attr.Value),
}
}
beginBlockTx.Events[i] = blockdb.Event{
Type: e.Type,
Attributes: attrs,
}
}
txs = append(txs, beginBlockTx)
}
if len(blockRes.EndBlockEvents) > 0 {
endBlockTx := blockdb.Tx{
Data: []byte(`{"data":"end_block","note":"this is a transaction artificially created for debugging purposes"}`),
}
endBlockTx.Events = make([]blockdb.Event, len(blockRes.EndBlockEvents))
for i, e := range blockRes.EndBlockEvents {
attrs := make([]blockdb.EventAttribute, len(e.Attributes))
for j, attr := range e.Attributes {
attrs[j] = blockdb.EventAttribute{
Key: string(attr.Key),
Value: string(attr.Value),
}
}
endBlockTx.Events[i] = blockdb.Event{
Type: e.Type,
Attributes: attrs,
}
}
txs = append(txs, endBlockTx)
}

return txs, nil
}
Expand Down
7 changes: 2 additions & 5 deletions chain/cosmos/codec.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package cosmos

import (
"cosmossdk.io/x/upgrade"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/auth"
authTx "github.com/cosmos/cosmos-sdk/x/auth/tx"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/capability"
"github.com/cosmos/cosmos-sdk/x/consensus"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/genutil"
Expand All @@ -20,8 +20,7 @@ import (
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
"github.com/cosmos/ibc-go/modules/capability"

transfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibccore "github.com/cosmos/ibc-go/v7/modules/core"
Expand All @@ -41,8 +40,6 @@ func DefaultEncoding() testutil.TestEncodingConfig {
gov.NewAppModuleBasic(
[]govclient.ProposalHandler{
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
},
),
params.AppModuleBasic{},
Expand Down
6 changes: 4 additions & 2 deletions chain/cosmos/cosmos_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"sync"

"cosmossdk.io/math"
sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
Expand Down Expand Up @@ -822,12 +823,12 @@ func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGene
chainCfg := c.Config()

genesisAmount := types.Coin{
Amount: types.NewInt(10_000_000_000_000),
Amount: sdkmath.NewInt(10_000_000_000_000),
Denom: chainCfg.Denom,
}

genesisSelfDelegation := types.Coin{
Amount: types.NewInt(5_000_000_000_000),
Amount: sdkmath.NewInt(5_000_000_000_000),
Denom: chainCfg.Denom,
}

Expand Down Expand Up @@ -936,6 +937,7 @@ func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGene
}

for _, wallet := range additionalGenesisWallets {

if err := validator0.AddGenesisAccount(ctx, wallet.Address, []types.Coin{{Denom: wallet.Denom, Amount: wallet.Amount}}); err != nil {
return err
}
Expand Down
Loading