Skip to content

Commit

Permalink
feat: remove orchestrator address (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id authored Feb 2, 2023
1 parent eaa987e commit 0b25d30
Show file tree
Hide file tree
Showing 55 changed files with 890 additions and 1,161 deletions.
3 changes: 1 addition & 2 deletions client/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ const (
FlagLogFormat = "log_format"

// QGB related flags
FlagOrchestratorAddress = "orchestrator-address"
FlagEVMAddress = "evm-address"
FlagEVMAddress = "evm-address"
)

// LineBreak can be included in a command list to provide a blank line
Expand Down
5 changes: 1 addition & 4 deletions proto/cosmos/staking/v1beta1/staking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,9 @@ message Validator {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// The orchestrator field is a celes1... string (i.e. sdk.AccAddress) that
// references the key that is being delegated to
string orchestrator = 12;
// This is a hex encoded 0x EVM public key that will be used by this
// validator on the target EVM chain.
string evm_address = 13;
string evm_address = 12;
}

// BondStatus is the status of a validator.
Expand Down
8 changes: 2 additions & 6 deletions proto/cosmos/staking/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@ message MsgCreateValidator {
string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"];
google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false];
// The orchestrator field is a celes1... string (i.e. sdk.AccAddress) that
// references the key that is being delegated to.
string orchestrator = 8;
// This is a hex encoded 0x EVM public key that will be used by this
// validator on the target EVM chain.
string evm_address = 9;
string evm_address = 8;
}

// MsgCreateValidatorResponse defines the Msg/CreateValidator response type.
Expand All @@ -91,8 +88,7 @@ message MsgEditValidator {
[(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"];
string min_self_delegation = 4
[(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"];
string orchestrator = 5;
string evm_address = 6;
string evm_address = 5;
}

// MsgEditValidatorResponse defines the Msg/EditValidator response type.
Expand Down
4 changes: 1 addition & 3 deletions simapp/simd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ func initTestnetFiles(
genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()})
genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0))

orchAddress := sdk.AccAddress(valPubKeys[i].Address())

evmAddress, err := teststaking.RandomEVMAddress()
if err != nil {
return err
Expand All @@ -303,7 +301,7 @@ func initTestnetFiles(
sdk.NewCoin(sdk.DefaultBondDenom, valTokens),
stakingtypes.NewDescription(nodeDirName, "", "", "", ""),
stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()),
sdk.OneInt(), orchAddress, *evmAddress,
sdk.OneInt(), *evmAddress,
)
if err != nil {
return err
Expand Down
32 changes: 14 additions & 18 deletions testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ type (

EVMPrivateKey *ecdsa.PrivateKey
EVMAddr common.Address

OrchestratorAddr sdk.AccAddress
}
)

Expand Down Expand Up @@ -423,7 +421,6 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
stakingtypes.NewDescription(nodeDirName, "", "", "", ""),
stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()),
sdk.OneInt(),
addr,
evmAddr,
)
if err != nil {
Expand Down Expand Up @@ -481,21 +478,20 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
WithAccountRetriever(cfg.AccountRetriever)

network.Validators[i] = &Validator{
AppConfig: appCfg,
ClientCtx: clientCtx,
Ctx: ctx,
Dir: filepath.Join(network.BaseDir, nodeDirName),
NodeID: nodeID,
PubKey: pubKey,
Moniker: nodeDirName,
RPCAddress: tmCfg.RPC.ListenAddress,
P2PAddress: tmCfg.P2P.ListenAddress,
APIAddress: apiAddr,
Address: addr,
ValAddress: sdk.ValAddress(addr),
EVMPrivateKey: evmPrivateKey,
EVMAddr: evmAddr,
OrchestratorAddr: addr,
AppConfig: appCfg,
ClientCtx: clientCtx,
Ctx: ctx,
Dir: filepath.Join(network.BaseDir, nodeDirName),
NodeID: nodeID,
PubKey: pubKey,
Moniker: nodeDirName,
RPCAddress: tmCfg.RPC.ListenAddress,
P2PAddress: tmCfg.P2P.ListenAddress,
APIAddress: apiAddr,
Address: addr,
ValAddress: sdk.ValAddress(addr),
EVMPrivateKey: evmPrivateKey,
EVMAddr: evmAddr,
}
}

Expand Down
2 changes: 1 addition & 1 deletion x/auth/migrations/v043/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ func createValidator(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers i
app.GetSubspace(stakingtypes.ModuleName),
)

val1, err := stakingtypes.NewValidator(valAddrs[0], pks[0], stakingtypes.Description{}, sdk.AccAddress(pks[0].Address()), *evmAddr)
val1, err := stakingtypes.NewValidator(valAddrs[0], pks[0], stakingtypes.Description{}, *evmAddr)
require.NoError(t, err)

app.StakingKeeper.SetValidator(ctx, val1)
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestVerifyProposerRewardAssignement(t *testing.T) {
validators[i].votes = make([]abci.VoteInfo, totalValidators)
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.CreateValidatorWithValPower(validators[i].addr, validators[i].pubkey, power, sdk.AccAddress(validators[i].addr), *randomEVMAddress, true)
tstaking.CreateValidatorWithValPower(validators[i].addr, validators[i].pubkey, power, *randomEVMAddress, true)
}
app.EndBlock(abci.RequestEndBlock{})
require.NotEmpty(t, app.Commit())
Expand Down
12 changes: 6 additions & 6 deletions x/distribution/keeper/allocation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) {

// create validator with 50% commission
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
tstaking.CreateValidator(sdk.ValAddress(addrs[0]), valConsPk1, sdk.NewInt(100), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(sdk.ValAddress(addrs[0]), valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)
val := app.StakingKeeper.Validator(ctx, valAddrs[0])

// allocate tokens
Expand Down Expand Up @@ -62,13 +62,13 @@ func TestAllocateTokensToManyValidators(t *testing.T) {

// create validator with 50% commission
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)

// create second validator with 0% commission
randomEVMAddress2, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[1], valConsPk2, sdk.NewInt(100), sdk.AccAddress(valConsPk2.Address()), *randomEVMAddress2, true)
tstaking.CreateValidator(valAddrs[1], valConsPk2, sdk.NewInt(100), *randomEVMAddress2, true)

abciValA := abci.Validator{
Address: valConsPk1.Address(),
Expand Down Expand Up @@ -140,19 +140,19 @@ func TestAllocateTokensTruncation(t *testing.T) {
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(110), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(110), *randomEVMAddress, true)

// create second validator with 10% commission
randomEVMAddress2, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[1], valConsPk2, sdk.NewInt(100), sdk.AccAddress(valConsPk2.Address()), *randomEVMAddress2, true)
tstaking.CreateValidator(valAddrs[1], valConsPk2, sdk.NewInt(100), *randomEVMAddress2, true)

// create third validator with 10% commission
randomEVMAddress3, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(1, 1), sdk.NewDecWithPrec(1, 1), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[2], valConsPk3, sdk.NewInt(100), sdk.AccAddress(valConsPk3.Address()), *randomEVMAddress3, true)
tstaking.CreateValidator(valAddrs[2], valConsPk3, sdk.NewInt(100), *randomEVMAddress3, true)

abciValA := abci.Validator{
Address: valConsPk1.Address(),
Expand Down
18 changes: 9 additions & 9 deletions x/distribution/keeper/delegation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestCalculateRewardsBasic(t *testing.T) {
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)

// end block to bond validator and start new block
staking.EndBlocker(ctx, app.StakingKeeper)
Expand Down Expand Up @@ -86,7 +86,7 @@ func TestCalculateRewardsAfterSlash(t *testing.T) {
valPower := int64(100)
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, *randomEVMAddress, true)

// end block to bond validator
staking.EndBlocker(ctx, app.StakingKeeper)
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) {
require.NoError(t, err)
valPower := int64(100)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, *randomEVMAddress, true)

// end block to bond validator
staking.EndBlocker(ctx, app.StakingKeeper)
Expand Down Expand Up @@ -227,7 +227,7 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) {
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)

// end block to bond validator
staking.EndBlocker(ctx, app.StakingKeeper)
Expand Down Expand Up @@ -302,7 +302,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) {
require.NoError(t, err)
power := int64(100)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
valTokens := tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, power, sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
valTokens := tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, power, *randomEVMAddress, true)

// assert correct initial balance
expTokens := balanceTokens.Sub(valTokens)
Expand Down Expand Up @@ -368,7 +368,7 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) {
require.NoError(t, err)
valPower := int64(100)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, *randomEVMAddress, true)

// end block to bond validator
staking.EndBlocker(ctx, app.StakingKeeper)
Expand Down Expand Up @@ -438,7 +438,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) {
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
valPower := int64(100)
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, *randomEVMAddress, true)

// end block to bond validator
staking.EndBlocker(ctx, app.StakingKeeper)
Expand Down Expand Up @@ -523,7 +523,7 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) {
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)

// end block to bond validator
staking.EndBlocker(ctx, app.StakingKeeper)
Expand Down Expand Up @@ -672,7 +672,7 @@ func Test100PercentCommissionReward(t *testing.T) {
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)

tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), sdk.AccAddress(valAddrs[0]), *randomEVMAddress, true)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)
app.StakingKeeper.Delegation(ctx, sdk.AccAddress(valAddrs[0]), valAddrs[0])

// end block to bond validator
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (suite *KeeperTestSuite) TestGRPCDelegationRewards() {
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
randomEVMAddress, err := teststaking.RandomEVMAddress()
suite.NoError(err)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(valAddrs[0], valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)

staking.EndBlocker(ctx, app.StakingKeeper)
ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1)
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func TestQueries(t *testing.T) {
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0))
randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(t, err)
tstaking.CreateValidator(valOpAddr1, valConsPk1, sdk.NewInt(100), sdk.AccAddress(valConsPk1.Address()), *randomEVMAddress, true)
tstaking.CreateValidator(valOpAddr1, valConsPk1, sdk.NewInt(100), *randomEVMAddress, true)

staking.EndBlocker(ctx, app.StakingKeeper)

Expand Down
2 changes: 1 addition & 1 deletion x/distribution/simulation/operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (suite *SimTestSuite) getTestingValidator(accounts []simtypes.Account, comm

randomEVMAddress, err := teststaking.RandomEVMAddress()
require.NoError(err)
validator, err := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes.Description{}, sdk.AccAddress(valPubKey.Address()), *randomEVMAddress)
validator, err := stakingtypes.NewValidator(valAddr, valPubKey, stakingtypes.Description{}, *randomEVMAddress)
require.NoError(err)
validator, err = validator.SetInitialCommission(commission)
require.NoError(err)
Expand Down
4 changes: 2 additions & 2 deletions x/evidence/keeper/infraction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (suite *KeeperTestSuite) TestHandleDoubleSign() {
suite.NoError(err)
tstaking := teststaking.NewHelper(suite.T(), ctx, suite.app.StakingKeeper)

selfDelegation := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, sdk.AccAddress(val.Address()), *randomEVMAddress, true)
selfDelegation := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, *randomEVMAddress, true)

// execute end-blocker and verify validator attributes
staking.EndBlocker(ctx, suite.app.StakingKeeper)
Expand Down Expand Up @@ -88,7 +88,7 @@ func (suite *KeeperTestSuite) TestHandleDoubleSign_TooOld() {
suite.NoError(err)
tstaking := teststaking.NewHelper(suite.T(), ctx, suite.app.StakingKeeper)

amt := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, sdk.AccAddress(val.Address()), *randomEVMAddress, true)
amt := tstaking.CreateValidatorWithValPower(operatorAddr, val, power, *randomEVMAddress, true)

// execute end-blocker and verify validator attributes
staking.EndBlocker(ctx, suite.app.StakingKeeper)
Expand Down
8 changes: 1 addition & 7 deletions x/genutil/client/cli/gentx.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o
--details="..." \
--security-contact="..." \
--website="..." \
--orchestrator-address="..." \
--evm-address="..."
`, defaultsDesc, version.AppName,
),
Expand Down Expand Up @@ -111,11 +110,6 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o
moniker = m
}

orchestratorAddress, err := cmd.Flags().GetString(flags.FlagOrchestratorAddress)
if err != nil {
return errors.Wrapf(err, "failed to get the orchestrator address")
}

evmAddress, err := cmd.Flags().GetString(flags.FlagEVMAddress)
if err != nil {
return errors.Wrapf(err, "failed to get the EVM address")
Expand All @@ -125,7 +119,7 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o
createValCfg, err := cli.PrepareConfigForTxCreateValidator(
cmd.Flags(), moniker,
nodeID, genDoc.ChainID,
valPubKey, orchestratorAddress,
valPubKey,
evmAddress,
)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions x/genutil/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func (s *IntegrationTestSuite) TestGenTxCmd() {
val.Moniker,
amount.String(),
fmt.Sprintf("--%s=%s", flags.FlagEVMAddress, val.EVMAddr.Hex()),
fmt.Sprintf("--%s=%s", flags.FlagOrchestratorAddress, val.OrchestratorAddr.String()),
},
expError: false,
},
Expand All @@ -95,7 +94,6 @@ func (s *IntegrationTestSuite) TestGenTxCmd() {
val.Moniker,
amount.String(),
fmt.Sprintf("--%s=%s", flags.FlagEVMAddress, val.EVMAddr.Hex()),
fmt.Sprintf("--%s=%s", flags.FlagOrchestratorAddress, val.OrchestratorAddr.String()),
},
expError: false,
},
Expand Down
2 changes: 0 additions & 2 deletions x/genutil/gentx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ func (suite *GenTxTestSuite) SetupTest() {
one := sdk.OneInt()
suite.msg1, err = stakingtypes.NewMsgCreateValidator(
sdk.ValAddress(pk1.Address()), pk1, amount, desc, comm, one,
sdk.AccAddress(pk1.Address()),
*evmAddr1,
)
suite.NoError(err)
suite.msg2, err = stakingtypes.NewMsgCreateValidator(
sdk.ValAddress(pk2.Address()), pk1, amount, desc, comm, one,
sdk.AccAddress(pk2.Address()),
*evmAddr2,
)
suite.NoError(err)
Expand Down
4 changes: 1 addition & 3 deletions x/genutil/types/genesis_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ func TestValidateGenesisMultipleMessages(t *testing.T) {

msg1, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk1.Address()), pk1,
sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, sdk.OneInt(),
sdk.AccAddress(pk1.Address()),
*evmAddr1,
)
require.NoError(t, err)

msg2, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk2.Address()), pk2,
sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, sdk.OneInt(),
sdk.AccAddress(pk2.Address()),
*evmAddr2,
)
require.NoError(t, err)
Expand All @@ -70,7 +68,7 @@ func TestValidateGenesisMultipleMessages(t *testing.T) {
func TestValidateGenesisBadMessage(t *testing.T) {
desc := stakingtypes.NewDescription("testname", "", "", "", "")

msg1 := stakingtypes.NewMsgEditValidator(sdk.ValAddress(pk1.Address()), desc, nil, nil, nil, nil)
msg1 := stakingtypes.NewMsgEditValidator(sdk.ValAddress(pk1.Address()), desc, nil, nil, nil)

txGen := simapp.MakeTestEncodingConfig().TxConfig
txBuilder := txGen.NewTxBuilder()
Expand Down
Loading

0 comments on commit 0b25d30

Please sign in to comment.