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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build, but everything is still broken
It builds, but the tests are a complete mess. Also define some types and stuff for #7... Lost in the mix.
- Loading branch information
1 parent
f0c0ed7
commit 17528b2
Showing
15 changed files
with
204 additions
and
153 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <eos/chain/message_handling_contexts.hpp> | ||
#include <eos/chain/permission_object.hpp> | ||
#include <eos/chain/exceptions.hpp> | ||
|
||
#include <boost/algorithm/cxx11/all_of.hpp> | ||
#include <boost/range/algorithm/find_if.hpp> | ||
|
||
namespace eos { namespace chain { | ||
|
||
void message_validate_context::require_authorization(const types::AccountName& account) { | ||
auto itr = boost::find_if(msg.authorization, [&account](const types::AccountPermission& ap) { | ||
return ap.account == account; | ||
}); | ||
EOS_ASSERT(itr != msg.authorization.end(), tx_missing_auth, | ||
"Required authorization ${auth} not found", ("auth", account)); | ||
|
||
used_authorizations[itr - msg.authorization.begin()] = true; | ||
} | ||
|
||
bool message_validate_context::all_authorizations_used() const { | ||
return boost::algorithm::all_of_equal(used_authorizations, true); | ||
} | ||
|
||
} } // namespace eos::chain |
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.