-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix: Signature only flag bug on tx sign command 7632 #8106
Merged
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
351c28f
fix: Signature only flag bug on tx sign command 7632
robert-zaremba 4308f1c
Update client/context.go
robert-zaremba 942d954
Merge branch 'master' into robert/fix-cli-sign
robert-zaremba 86e1ca7
Update client/context.go
robert-zaremba 50568a4
Merge branch 'master' into robert/fix-cli-sign
sahith-narahari 09984c6
use named return value and closure (#8111)
b97a939
set the right 'append' logic for signing transactions
robert-zaremba 7d96902
cleanup
robert-zaremba a0d26fb
update tx.Sign interface by adding overwrite option
robert-zaremba ac324b3
Update Changelog
robert-zaremba 1b16901
sign command cleanup
robert-zaremba 9d5ce97
implementation and changelog update
robert-zaremba e774b31
fix SignTx and tx.Sign calls
robert-zaremba e731b5a
fix: sign didn't write to a file
robert-zaremba 4784d93
update flags description
robert-zaremba 2048a8a
Merge branch 'master' into robert/fix-cli-sign
robert-zaremba b1e3cbd
Add tx.Sign tests
robert-zaremba edc19dc
fix grpc/server_test.go
robert-zaremba 8818f64
Update client/tx/tx.go
robert-zaremba 7e39258
changelog update
robert-zaremba 3ed4d36
Add test to verify matching signatures
robert-zaremba cd6b700
cli_test: add integration tests for sign CMD
robert-zaremba fe3acef
add output-file flag test
robert-zaremba c2c74c6
add flagAmino test
robert-zaremba 82d28b8
Update x/auth/client/cli/tx_sign.go
robert-zaremba 87d027a
Update x/auth/client/cli/tx_sign.go
b8256a8
update amino serialization test
robert-zaremba a00e8ec
TestSign: adding unit test for signing with different modes
robert-zaremba c0c1c48
Add test with Multi Signers into Robert's TxSign PR (#8142)
amaury1093 6405295
cleanups
robert-zaremba 9b9b9dc
Merge branch 'master' into robert/fix-cli-sign
robert-zaremba d61f340
client.Sign: raise error when signing tx with multiple signers in Direct
robert-zaremba 8cbcff1
add more tests
robert-zaremba 25e4915
Update client/tx/tx_test.go
robert-zaremba 17f210b
fix TestGetBroadcastCommand_WithoutOfflineFlag
robert-zaremba 46b50b2
Any.UnsafeSetCachedValue
robert-zaremba 8e55e13
fix note packed messages in tx builder
robert-zaremba a263570
reorder unit tests
robert-zaremba 68d9b37
Changelog update
robert-zaremba febbca9
cleaning / linting
robert-zaremba ae2ce73
cli_tes: copy validator object instead of modifying it's shared codec
robert-zaremba 1407caa
x/auth cli_test: remove custom codec creation in tests
robert-zaremba d71fe5a
Merge branch 'master' into robert/fix-cli-sign
mergify[bot] df7be40
Update CHANGELOG.md
clevinson 94c42a0
updates to CHANGELOG.md
clevinson 48659f8
remove unused method
robert-zaremba 5547aaa
add new instance of transaction builder for TestSign
robert-zaremba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There may be something slightly more complicated going on here that we need to be careful about. If you read above, we are only calling this
SetSignatures()
method with an empty sig so that the underlyingtxBuilder
can set theSignModes
which is necessary for generating the bytesToSign below.In the case of
--append
flag, I think that we actually want to callSetSignatures()
with the pre-existing list of existing signatures + the empty new signature.e.g. i think the full overwrite logic here needs to be something more like:
Would be good to get confirmation from @amaurymartiny but i think this is correct logic.
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.
I've added a test to verify the matching signatures. It works. The reason the signatures are reset here is to set the right signing mode.
The
wrapper
and client signing functions are not very clear. As I wrote in the summary above, it should probably be rewritten.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.
I think the edge case that might be missing here is if you have two different signatures with different sign modes. Does the test work in that case as well?
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.
I've added one more tests for signing with a different factory which has a different mode:
In fact your patch doesn't work, because the
wrapper
(TxBuilder) is wrongly implemented - it doesn't know which key it should use to sign nor the mode to use. That logic is handled independently, throughtxFactory
and maybe totally different then the mode set in theTxBuilder
signature placeholder. In my opinion this is error prone, but that's something for a new task.