-
Notifications
You must be signed in to change notification settings - Fork 648
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
have verify_account_authority check passed-in keys #1384
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7d44c3a
initial fix for verify_account_authority
jmjatlanta 824ed4f
improved way to verify account and keys
jmjatlanta 48fa400
Removed unneeded method definition
jmjatlanta c2b63f5
Added multiple signatures to test
jmjatlanta 5db31f5
shorten line length
jmjatlanta 7e4e033
add test for multisig
jmjatlanta e03d329
improved multisig test
jmjatlanta 673ac2b
fix short line
jmjatlanta f523ad6
moved tests, fixed comments
jmjatlanta b078310
clarify comment
jmjatlanta 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -663,9 +663,12 @@ class database_api | |
bool verify_authority( const signed_transaction& trx )const; | ||
|
||
/** | ||
* @return true if the signers have enough authority to authorize an account | ||
* @brief Verify that the public keys have enough authority to approve an operation | ||
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. I think we should mention the account in this sentence and the return 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. I think the latest commit will be more to your liking. Please take a look. |
||
* @param account_name_or_id the account to check | ||
* @param signers the public keys | ||
* @return true if the passed in keys have enough authority to approve an operation | ||
*/ | ||
bool verify_account_authority( const string& account_name_or_id, const flat_set<public_key_type>& signers )const; | ||
bool verify_account_authority( const string& account_name_or_id, const flat_set<public_key_type>& signers )const; | ||
|
||
/** | ||
* Validates a transaction against the current state without broadcasting it on the network. | ||
|
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
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.
why not just to create
signed_transaction
and call it'sverify_authority
method ?So the full implementation of
verify_account_authority
might be like next:It's less code and more simple IMHO.
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.
Nice idea, but IMO the signees field should be used as an internal cache only, not part of the tx struct's interface.
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.
graphene::chain::verify_authority
will usesignees
returned bysigned_transaction::get_signature_keys
method, so it should work