-
Notifications
You must be signed in to change notification settings - Fork 4.2k
refactor(bank, feegrant, authz): avoid creating baseaccount #19188
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
Changes from all commits
ccb4311
668c961
403c4b4
ba1bb32
e91220c
24840c7
89ddd38
4b66f08
0e697b8
3af1c1d
ff2e36d
2e33997
db651c7
4c20c49
4edf881
cf95cad
c65ac18
d68dd33
ee38e20
6d01885
46e9662
0a74d4c
69e273c
895829e
29eb7b9
bc1c1fa
92b51f9
4649384
623c15b
b7faac8
dec62e9
bc45772
b89fc84
2c15dda
16e43a3
c4b7838
4cbfd64
9822b43
c26ee9c
f0e8964
a5e4320
4125905
3ab6f07
f72d5d7
1a81a74
e4568b7
2b53269
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -75,6 +75,7 @@ type fixture struct { | |||||||||||
| sdkCtx sdk.Context | ||||||||||||
| cdc codec.Codec | ||||||||||||
|
|
||||||||||||
| accountKeeper authkeeper.AccountKeeper | ||||||||||||
tac0turtle marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
| bankKeeper bankkeeper.Keeper | ||||||||||||
| evidenceKeeper *keeper.Keeper | ||||||||||||
| slashingKeeper slashingkeeper.Keeper | ||||||||||||
|
|
@@ -164,6 +165,7 @@ func initFixture(tb testing.TB) *fixture { | |||||||||||
| app: integrationApp, | ||||||||||||
| sdkCtx: sdkCtx, | ||||||||||||
| cdc: cdc, | ||||||||||||
| accountKeeper: accountKeeper, | ||||||||||||
| bankKeeper: bankKeeper, | ||||||||||||
| evidenceKeeper: evidenceKeeper, | ||||||||||||
| slashingKeeper: slashingKeeper, | ||||||||||||
|
|
@@ -183,7 +185,7 @@ func TestHandleDoubleSign(t *testing.T) { | |||||||||||
| assert.NilError(t, err) | ||||||||||||
| operatorAddr, valpubkey := valAddresses[0], pubkeys[0] | ||||||||||||
| tstaking := stakingtestutil.NewHelper(t, ctx, f.stakingKeeper) | ||||||||||||
|
|
||||||||||||
| f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr))) | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing error handling for - f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr)))
+ err := f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr)))
+ if err != nil {
+ t.Fatalf("Failed to set account: %v", err)
+ }Committable suggestion
Suggested change
|
||||||||||||
| selfDelegation := tstaking.CreateValidatorWithValPower(operatorAddr, valpubkey, power, true) | ||||||||||||
|
|
||||||||||||
| // execute end-blocker and verify validator attributes | ||||||||||||
|
|
@@ -278,7 +280,7 @@ func TestHandleDoubleSign_TooOld(t *testing.T) { | |||||||||||
| operatorAddr, valpubkey := valAddresses[0], pubkeys[0] | ||||||||||||
|
|
||||||||||||
| tstaking := stakingtestutil.NewHelper(t, ctx, f.stakingKeeper) | ||||||||||||
|
|
||||||||||||
| f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr))) | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing error handling for - f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr)))
+ err := f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr)))
+ if err != nil {
+ t.Fatalf("Failed to set account: %v", err)
+ }Committable suggestion
Suggested change
|
||||||||||||
| amt := tstaking.CreateValidatorWithValPower(operatorAddr, valpubkey, power, true) | ||||||||||||
|
|
||||||||||||
| // execute end-blocker and verify validator attributes | ||||||||||||
|
|
@@ -328,7 +330,7 @@ func TestHandleDoubleSignAfterRotation(t *testing.T) { | |||||||||||
|
|
||||||||||||
| operatorAddr, valpubkey := valAddresses[0], pubkeys[0] | ||||||||||||
| tstaking := stakingtestutil.NewHelper(t, ctx, f.stakingKeeper) | ||||||||||||
|
|
||||||||||||
| f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr))) | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing error handling for - f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr)))
+ err := f.accountKeeper.SetAccount(f.sdkCtx, f.accountKeeper.NewAccountWithAddress(f.sdkCtx, sdk.AccAddress(operatorAddr)))
+ if err != nil {
+ t.Fatalf("Failed to set account: %v", err)
+ }Committable suggestion
Suggested change
|
||||||||||||
| selfDelegation := tstaking.CreateValidatorWithValPower(operatorAddr, valpubkey, power, true) | ||||||||||||
|
|
||||||||||||
| // execute end-blocker and verify validator attributes | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.