refactor: remove global valaddress bech32 codec calls (1/2) (#17098)

Co-authored-by: Devon Bear <itsdevbear@berachain.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
Marko
2023-07-26 19:01:21 +00:00
committed by GitHub
co-authored by Devon Bear Julien Robert
parent 026073ba19
commit 58855c6859
91 changed files with 543 additions and 349 deletions
@@ -8,6 +8,7 @@ import (
"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/codec/address"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
@@ -40,7 +41,7 @@ func TestCancelUnbondingDelegation(t *testing.T) {
delegatorAddr := addrs[1]
// setup a new validator with bonded status
validator, err := types.NewValidator(valAddr, PKs[0], types.NewDescription("Validator", "", "", "", ""))
validator, err := types.NewValidator(valAddr.String(), PKs[0], types.NewDescription("Validator", "", "", "", ""))
validator.Status = types.Bonded
assert.NilError(t, err)
assert.NilError(t, f.stakingKeeper.SetValidator(ctx, validator))
@@ -55,6 +56,7 @@ func TestCancelUnbondingDelegation(t *testing.T) {
ctx.BlockTime().Add(time.Minute*10),
unbondingAmount.Amount,
0,
address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmos"),
)
// set and retrieve a record