Skip to content

Commit

Permalink
Merge pull request #560 from PeggyJV/collin/sdk-0.47
Browse files Browse the repository at this point in the history
Upgrade to Cosmos SDK 0.47
  • Loading branch information
cbrit authored May 7, 2024
2 parents 2329978 + 543fbc1 commit c36490e
Show file tree
Hide file tree
Showing 108 changed files with 4,708 additions and 27,181 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automated-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: setup-go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
# Setup Rust Environment
- name: setup-rust
uses: actions-rs/toolchain@v1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
- name: Checkout Branch
uses: actions/checkout@v2
- name: Create Go cache
Expand All @@ -28,8 +28,8 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('module/go.sum') }}
- name: Run Go tests
run: cd module && make test-cov
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./module/coverage.txt
fail_ci_if_error: true
# - uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./module/coverage.txt
# fail_ci_if_error: true
8 changes: 4 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ jobs:
packages: write
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.19
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
- name: checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
Expand Down Expand Up @@ -234,10 +234,10 @@ jobs:
]

steps:
- name: Set up Go 1.19
- name: Set up Go 1.22
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.22
- name: checkout
uses: actions/checkout@v2
- name: go-cache
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ fail:
@false

e2e_happy_path: e2e_clean_slate
integration_tests/integration-tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestHappyPath || make -s fail
E2E_SKIP_CLEANUP=true integration_tests/integration_tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestHappyPath || make -s fail

e2e_valset_update: e2e_clean_slate
integration_tests/integration-tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestValsetUpdate || make -s fail
integration_tests/integration_tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestValsetUpdate || make -s fail


e2e_validator_out: e2e_clean_slate
integration_tests/integration-tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestValidatorOut || make -s fail
integration_tests/integration_tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestValidatorOut || make -s fail

e2e_transaction_stress: e2e_clean_slate
integration_tests/integration-tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestTransactionStress || make -s fail
integration_tests/integration_tests.test -test.failfast -test.v -test.run IntegrationTestSuite -testify.m TestTransactionStress || make -s fail

6 changes: 6 additions & 0 deletions go.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
go 1.22.1

use (
./integration_tests
./module
)
1,089 changes: 1,089 additions & 0 deletions go.work.sum

Large diffs are not rendered by default.

76 changes: 53 additions & 23 deletions integration_tests/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,45 @@ import (
"fmt"
"os"

tmrand "github.com/cometbft/cometbft/libs/rand"
rpchttp "github.com/cometbft/cometbft/rpc/client/http"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
sdkTypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
sdkTx "github.com/cosmos/cosmos-sdk/x/auth/tx"
"github.com/cosmos/cosmos-sdk/x/auth"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/capability"
"github.com/cosmos/cosmos-sdk/x/consensus"
"github.com/cosmos/cosmos-sdk/x/crisis"
"github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/evidence"
"github.com/cosmos/cosmos-sdk/x/genutil"
"github.com/cosmos/cosmos-sdk/x/gov"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
"github.com/cosmos/cosmos-sdk/x/mint"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
ibctransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v7/modules/core"
"github.com/peggyjv/gravity-bridge/module/v4/app"
"github.com/peggyjv/gravity-bridge/module/v4/app/params"
gravityclient "github.com/peggyjv/gravity-bridge/module/v4/x/gravity/client"
gravitytypes "github.com/peggyjv/gravity-bridge/module/v4/x/gravity/types"
tmrand "github.com/tendermint/tendermint/libs/rand"
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
)

const (
Expand Down Expand Up @@ -191,25 +209,37 @@ func (c *chain) createOrchestrator(index int) *orchestrator {
}

func (c *chain) clientContext(nodeURI string, kb *keyring.Keyring, fromName string, fromAddr sdk.AccAddress) (*client.Context, error) {
amino := codec.NewLegacyAmino()
interfaceRegistry := sdkTypes.NewInterfaceRegistry()
interfaceRegistry.RegisterImplementations((*sdk.Msg)(nil),
encodingConfig := moduletestutil.MakeTestEncodingConfig(
auth.AppModuleBasic{},
genutil.AppModuleBasic{},
bank.AppModuleBasic{},
capability.AppModuleBasic{},
consensus.AppModuleBasic{},
staking.AppModuleBasic{},
mint.AppModuleBasic{},
distribution.AppModuleBasic{},
gov.NewAppModuleBasic(
[]govclient.ProposalHandler{
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
gravityclient.ProposalHandler,
},
),
//params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
ibc.AppModuleBasic{},
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
ibctransfer.AppModuleBasic{},
vesting.AppModuleBasic{},
)
encodingConfig.InterfaceRegistry.RegisterImplementations((*sdk.Msg)(nil),
&stakingtypes.MsgCreateValidator{},
&gravitytypes.MsgDelegateKeys{},
)
interfaceRegistry.RegisterImplementations((*cryptotypes.PubKey)(nil), &secp256k1.PubKey{}, &ed25519.PubKey{})

protoCodec := codec.NewProtoCodec(interfaceRegistry)
txCfg := sdkTx.NewTxConfig(protoCodec, sdkTx.DefaultSignModes)

encodingConfig := params.EncodingConfig{
InterfaceRegistry: interfaceRegistry,
Marshaler: protoCodec,
TxConfig: txCfg,
Amino: amino,
}
simapp.ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
simapp.ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
encodingConfig.InterfaceRegistry.RegisterImplementations((*cryptotypes.PubKey)(nil), &secp256k1.PubKey{}, &ed25519.PubKey{})

rpcClient, err := rpchttp.New(nodeURI, "/websocket")
if err != nil {
Expand All @@ -218,14 +248,14 @@ func (c *chain) clientContext(nodeURI string, kb *keyring.Keyring, fromName stri

clientContext := client.Context{}.
WithChainID(c.id).
WithCodec(protoCodec).
WithCodec(encodingConfig.Codec).
WithInterfaceRegistry(encodingConfig.InterfaceRegistry).
WithTxConfig(encodingConfig.TxConfig).
WithLegacyAmino(encodingConfig.Amino).
WithInput(os.Stdin).
WithNodeURI(nodeURI).
WithClient(rpcClient).
WithBroadcastMode(flags.BroadcastBlock).
WithBroadcastMode(flags.BroadcastSync).
WithKeyring(*kb).
WithAccountRetriever(authtypes.AccountRetriever{}).
WithOutputFormat("json").
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"fmt"
"os"

tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/server"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
tmtypes "github.com/tendermint/tendermint/types"
)

func getGenDoc(path string) (*tmtypes.GenesisDoc, error) {
Expand Down
Loading

0 comments on commit c36490e

Please sign in to comment.