fix: allow non-EOA accounts to stake in simulation (#16068)
Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
@@ -392,9 +392,9 @@ func SimulateMsgUndelegate(
|
||||
break
|
||||
}
|
||||
}
|
||||
// if simaccount.PrivKey == nil, delegation address does not exist in accs. Return error
|
||||
// if simaccount.PrivKey == nil, delegation address does not exist in accs. However, since smart contracts and module accounts can stake, we can ignore the error
|
||||
if simAccount.PrivKey == nil {
|
||||
return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "account private key is nil"), nil, fmt.Errorf("delegation addr: %s does not exist in simulation accounts", delAddr)
|
||||
return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "account private key is nil"), nil, nil
|
||||
}
|
||||
|
||||
account := ak.GetAccount(ctx, delAddr)
|
||||
@@ -581,9 +581,9 @@ func SimulateMsgBeginRedelegate(
|
||||
}
|
||||
}
|
||||
|
||||
// if simaccount.PrivKey == nil, delegation address does not exist in accs. Return error
|
||||
// if simaccount.PrivKey == nil, delegation address does not exist in accs. However, since smart contracts and module accounts can stake, we can ignore the error
|
||||
if simAccount.PrivKey == nil {
|
||||
return simtypes.NoOpMsg(types.ModuleName, msgType, "account private key is nil"), nil, fmt.Errorf("delegation addr: %s does not exist in simulation accounts", delAddr)
|
||||
return simtypes.NoOpMsg(types.ModuleName, msgType, "account private key is nil"), nil, nil
|
||||
}
|
||||
|
||||
account := ak.GetAccount(ctx, delAddr)
|
||||
|
||||
Reference in New Issue
Block a user