-
Notifications
You must be signed in to change notification settings - Fork 52
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
Bank: unit tests for SDK v0.44.3 Bump #339
Conversation
feat: add authz and feegrant modules to simapp fix: replace InitializeandSeal with Seal in app
fix: update upgrade handler template
* fix some bugs & structs. upgrade to sdk 0.44.3 * remove authz and feegrant modules * revert banktypes to sdkbanktypes * rename Codec to Marshaler, and fix simulations * fix gov tally logic * add evidence to exportgenesis * refactor voteoptions handling
* add dependencies requirement to lint * update golang version * add timeout config to lint
Please make sure to remove all conflicts. And I think some files were added by mistake. |
x/bank/keeper/keeper_test.go
Outdated
|
||
queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) | ||
types.RegisterMsgServer(queryHelper, suite.queryClient) | ||
suite.queryClient = &types.UnimplementedMsgServer{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we initialize with the module's query client here?
x/bank/keeper/keeper_test.go
Outdated
args args | ||
errArgs errArgs | ||
}{ | ||
{"Operator(1) Create: first send test case if coins is not greater than total amount", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does Operator Create mean here
x/bank/keeper/keeper_test.go
Outdated
args args | ||
errArgs errArgs | ||
}{ | ||
{"Operator(1) Create: first send test case if coins is not greater than total amount", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also let's make the test names a complete sentence or at least have correct grammar
x/bank/keeper/keeper_test.go
Outdated
suite.Run(tc.name, func() { | ||
suite.SetupTest() | ||
inputs := []bankTypes.Input{ | ||
{Address: tc.args.Addr1.String(), Coins: sdk.Coins{sdk.NewInt64Coin("ctk", tc.args.amount)}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't be using ctk
. it should be common.microctkdenom
x/bank/types/types_test.go
Outdated
fromAddr: suite.address[0], | ||
toAddr: suite.address[1], | ||
unlockerAddress: suite.address[2], | ||
res: "[696E70757431999]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean?
@@ -168,7 +168,6 @@ jobs: | |||
export BUILD_TAGS="netgo ledger" | |||
export GOSUM=$(sha256sum go.sum | cut -d ' ' -f1) | |||
curl -sL https://git.io/goreleaser | bash | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why delete these lines?
x/bank/keeper/keeper_test.go
Outdated
if tc.errArgs.shouldPass { | ||
suite.Require().NoError(err, tc.name) | ||
suite.Require().NotEqual(tc.args.sendAmt, balance) | ||
suite.Require().Equal(sdk.Coins{sdk.NewInt64Coin("uctk", tc.args.accBalance)}, balance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use common.MicroCTKDenom
x/bank/keeper/keeper_test.go
Outdated
{Address: tc.args.Addr1.String(), Coins: sdk.Coins{sdk.NewInt64Coin("uctk", tc.args.amount)}}, | ||
{Address: tc.args.Addr1.String(), Coins: sdk.Coins{sdk.NewInt64Coin("uctk", tc.args.amount)}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
x/bank/keeper/keeper_test.go
Outdated
{Address: tc.args.Addr2.String(), Coins: sdk.Coins{sdk.NewInt64Coin("uctk", tc.args.amount)}}, | ||
{Address: tc.args.Addr3.String(), Coins: sdk.Coins{sdk.NewInt64Coin("uctk", tc.args.amount)}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never use hard coded "uctk" in the rest of the codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
x/bank/keeper/keeper_test.go
Outdated
suite.Require().NotNil(baseAcc) | ||
suite.Require().NoError(err) | ||
suite.Require().NotNil(toAcc) | ||
suite.Require().Equal(balances, sdk.Coins{sdk.NewInt64Coin("uctk", tc.args.accBalance)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use NewCoins() instead of direct struct
CHANGELOG.md
Outdated
### Bug Fixes | ||
### Bug Fixes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this change for?
app/params/proto.go
Outdated
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this if you can
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Closes: #XXX
Related: #XXX
Description
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)