Skip to content
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

Merged
merged 60 commits into from
Feb 1, 2022
Merged

Bank: unit tests for SDK v0.44.3 Bump #339

merged 60 commits into from
Feb 1, 2022

Conversation

uwezukwechibuzor
Copy link
Contributor

Closes: #XXX
Related: #XXX

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]"

Michael Park and others added 30 commits September 13, 2021 15:16
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
@hacheigriega
Copy link
Contributor

Please make sure to remove all conflicts. And I think some files were added by mistake.


queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry())
types.RegisterMsgServer(queryHelper, suite.queryClient)
suite.queryClient = &types.UnimplementedMsgServer{}
Copy link
Contributor

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?

args args
errArgs errArgs
}{
{"Operator(1) Create: first send test case if coins is not greater than total amount",
Copy link
Collaborator

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

args args
errArgs errArgs
}{
{"Operator(1) Create: first send test case if coins is not greater than total amount",
Copy link
Collaborator

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

suite.Run(tc.name, func() {
suite.SetupTest()
inputs := []bankTypes.Input{
{Address: tc.args.Addr1.String(), Coins: sdk.Coins{sdk.NewInt64Coin("ctk", tc.args.amount)}},
Copy link
Collaborator

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

fromAddr: suite.address[0],
toAddr: suite.address[1],
unlockerAddress: suite.address[2],
res: "[696E70757431999]",
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete these lines?

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use common.MicroCTKDenom

Comment on lines 202 to 203
{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)}},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Comment on lines 206 to 207
{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)}},
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

suite.Require().NotNil(baseAcc)
suite.Require().NoError(err)
suite.Require().NotNil(toAcc)
suite.Require().Equal(balances, sdk.Coins{sdk.NewInt64Coin("uctk", tc.args.accBalance)})
Copy link
Collaborator

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
Copy link
Collaborator

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?

}
}
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@uwezukwechibuzor uwezukwechibuzor requested review from hacheigriega and yoongbok-lee and removed request for hacheigriega and yoongbok-lee February 1, 2022 11:49
@yoongbok-lee yoongbok-lee merged commit 7f19994 into master Feb 1, 2022
@yoongbok-lee yoongbok-lee deleted the cu/unit_tests branch February 1, 2022 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve tests across modules
5 participants