This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add multi-sig recovery tests. stat-291 #1466
Merged
wanderingbort
merged 2 commits into
EOSIO:master
from
cijujohn:accountRecoveryTest-dawn291
Feb 26, 2018
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,26 @@ BOOST_FIXTURE_TEST_CASE( missing_sigs, tester ) { try { | |
produce_block(); | ||
|
||
BOOST_REQUIRE_THROW( push_reqauth( N(alice), {permission_level{N(alice), config::active_name}}, {} ), tx_missing_sigs ); | ||
auto trace = push_reqauth(N(alice), {permission_level{N(alice), config::active_name}}, { get_private_key(N(alice), "active") } ); | ||
auto trace = push_reqauth(N(alice), "owner"); | ||
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. while more concise, this does change the semantics by signing with the "owner" key/permission instead of the active. We should probably just leave the exploded version that was in place before |
||
|
||
produce_block(); | ||
produce_block(); | ||
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. fix whitespace |
||
BOOST_REQUIRE_EQUAL(true, chain_has_transaction(trace.id)); | ||
|
||
} FC_LOG_AND_RETHROW() } /// missing_sigs | ||
|
||
BOOST_FIXTURE_TEST_CASE( missing_multi_sigs, tester ) { try { | ||
produce_block(); | ||
create_account(N(alice), config::system_account_name, true); | ||
produce_block(); | ||
|
||
BOOST_REQUIRE_THROW(push_reqauth(N(alice), "owner"), tx_missing_sigs); // without multisig | ||
auto trace = push_reqauth(N(alice), "owner", true); // with multisig | ||
|
||
produce_block(); | ||
BOOST_REQUIRE_EQUAL(true, chain_has_transaction(trace.id)); | ||
|
||
} FC_LOG_AND_RETHROW() } /// missing_multi_sigs | ||
|
||
BOOST_FIXTURE_TEST_CASE( missing_auths, tester ) { try { | ||
create_accounts( {N(alice), N(bob)} ); | ||
produce_block(); | ||
|
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.
This seems to be an "up-port" of the method call that used to only exist for recovery tests.
In the context of recovery tests using the "owner" permission level makes sense however, in most other cases that seems to be a mis-use as the concept of "owner" is that it is very rarely used.
It seems this was done to make the
missing_multi_sigs
tests case more concise but as that could be done with the "Active" permission level and thepush_reqauth
that already existed with a few more keys strokes maybe we should keep this "owner" bomb in the recover tester?