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

refactor(runtime): define address codec providers in runtime #17037

Merged
merged 11 commits into from
Jul 18, 2023
Merged
Prev Previous commit
fix tests
  • Loading branch information
julienrbrt committed Jul 18, 2023
commit be4075439b61801ef6fca336959a4c8ead518c39
10 changes: 8 additions & 2 deletions crypto/keys/multisig/multisig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ import (

"github.com/stretchr/testify/require"

"cosmossdk.io/core/address"
"cosmossdk.io/depinject"
"cosmossdk.io/log"

"github.com/cosmos/cosmos-sdk/codec"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
_ "github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil/configurator"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
Expand Down Expand Up @@ -359,7 +361,11 @@ func TestDisplay(t *testing.T) {
err := depinject.Inject(
depinject.Configs(
configurator.NewAppConfig(),
depinject.Supply(log.NewNopLogger()),
depinject.Supply(log.NewNopLogger(),
func() address.Codec { return addresscodec.NewBech32Codec("cosmos") },
func() runtime.ValidatorAddressCodec { return addresscodec.NewBech32Codec("cosmosvaloper") },
func() runtime.ConsensusAddressCodec { return addresscodec.NewBech32Codec("cosmosvalcons") },
),
), &cdc)
require.NoError(err)
bz, err := cdc.MarshalInterfaceJSON(msig)
Expand Down