-
Notifications
You must be signed in to change notification settings - Fork 28
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
Added test to check multisig and authz work together #462
Conversation
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @wojtek-coreum)
integration-tests/modules/auth_test.go
line 227 at r1 (raw file):
// TestAuthMultisigWithAuthz tests the cosmos-sdk multisig accounts works with authz. func TestAuthMultisigWithAuthz(t *testing.T) {
The logic we wanted to test is different:
granter should be multisig account
and grantee should be usual account
integration-tests/modules/auth_test.go
line 227 at r1 (raw file):
// TestAuthMultisigWithAuthz tests the cosmos-sdk multisig accounts works with authz. func TestAuthMultisigWithAuthz(t *testing.T) {
minor:
IMO more logical place for this test is authz_test
integration-tests/modules/auth_test.go
line 234 at r1 (raw file):
requireT := require.New(t) signer1KeyInfo, err := chain.ClientContext.Keyring().KeyByAddress(chain.GenAccount())
IMO it makes sense to move multisig acc creation logic to a separate func since we reuse it in multiple places now
smth like:
func GenMultisig(sigNumber, threshold uint) # returns multisig account & list of signers
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @wojtek-coreum)
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
integration-tests/modules/auth_test.go
line 234 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
IMO it makes sense to move multisig acc creation logic to a separate func since we reuse it in multiple places now
smth like:
func GenMultisig(sigNumber, threshold uint) # returns multisig account & list of signers
Agree, because the code of the test is simpler than test preparation.
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
integration-tests/modules/auth_test.go
line 227 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
The logic we wanted to test is different:
granter should be multisig account
and grantee should be usual account
Done both ways.
integration-tests/modules/auth_test.go
line 234 at r1 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Agree, because the code of the test is simpler than test preparation.
Done.
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68, @silverspase, and @wojtek-coreum)
integration-tests/modules/authz_test.go
line 264 at r2 (raw file):
grantee, authztypes.NewGenericAuthorization(sdk.MsgTypeURL(&banktypes.MsgSend{})), time.Now().Add(time.Hour),
any specific reason to use hour in one test & minute in another ?
I suggest to stick to one version everywhere
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @silverspase, @wojtek-coreum, and @ysv)
integration-tests/modules/authz_test.go
line 264 at r2 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
any specific reason to use hour in one test & minute in another ?
I suggest to stick to one version everywhere
Done.
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.
Reviewed 1 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68, @silverspase, and @ysv)
integration-tests/modules/auth_test.go
line 202 at r3 (raw file):
} func createMultisigAccount(
Maybe it should be a method of the chain
?
integration-tests/modules/authz_test.go
line 150 at r3 (raw file):
multisigPublicKey, keyNamesSet := createMultisigAccount(t, chain, 3, 2) multisigAddress, err := sdk.AccAddressFromHex(multisigPublicKey.Address().String())
what about:
multisigAddress := multisigPublicKey.Address()
?
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @miladz68, @silverspase, and @wojtek-coreum)
integration-tests/modules/auth_test.go
line 202 at r3 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
Maybe it should be a method of the
chain
?
good point, I agree
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase and @wojtek-coreum)
integration-tests/modules/auth_test.go
line 202 at r3 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
good point, I agree
Done.
integration-tests/modules/authz_test.go
line 150 at r3 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
what about:
multisigAddress := multisigPublicKey.Address()?
Done.
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.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
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.
Reviewed 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase and @wojtek-coreum)
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.
Reviewed 3 of 3 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase)
0108971
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.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase)
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.
Reviewed 2 of 3 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase)
This change is