480 {
481 const auto& checktime = (
static_cast<bool>(_checktime) ? _checktime :
_noop_checktime );
482
484
486
489 provided_keys,
490 provided_permissions,
491 effective_provided_delay,
492 checktime
493 );
494
495 map<permission_level, fc::microseconds> permissions_to_satisfy;
496
497 for( const auto& act : actions ) {
498 bool special_case = false;
500
501 if( act.account == config::system_account_name ) {
502 special_case = true;
503
505 check_updateauth_authorization( act.data_as<updateauth>(), act.authorization );
507 check_deleteauth_authorization( act.data_as<deleteauth>(), act.authorization );
509 check_linkauth_authorization( act.data_as<linkauth>(), act.authorization );
511 check_unlinkauth_authorization( act.data_as<unlinkauth>(), act.authorization );
513 delay = std::max( delay, check_canceldelay_authorization(act.data_as<canceldelay>(), act.authorization) );
514 } else {
515 special_case = false;
516 }
517 }
518
519 for( const auto& declared_auth : act.authorization ) {
520
521 checktime();
522
523 if( !special_case ) {
525 if( min_permission_name ) {
526 const auto& min_permission =
get_permission({declared_auth.actor, *min_permission_name});
529 irrelevant_auth_exception,
530 "action declares irrelevant authority '${auth}'; minimum authority is ${min}",
531 ("auth", declared_auth)("min", permission_level{min_permission.owner, min_permission.name}) );
532 }
533 }
534
535 if( satisfied_authorizations.find( declared_auth ) == satisfied_authorizations.end() ) {
536 auto res = permissions_to_satisfy.emplace( declared_auth, delay );
537 if( !res.second && res.first->second > delay) {
538 res.first->second =
delay;
539 }
540 }
541 }
542 }
543
544
545
546
547
548
549
550
551 for(
const auto&
p : permissions_to_satisfy ) {
552 checktime();
553 SYS_ASSERT( checker.satisfied(
p.first,
p.second ) || check_but_dont_fail, unsatisfied_authorization,
554 "transaction declares authority '${auth}', "
555 "but does not have signatures for it under a provided delay of ${provided_delay} ms, "
556 "provided permissions ${provided_permissions}, provided keys ${provided_keys}, "
557 "and a delay max limit of ${delay_max_limit_ms} ms",
559 (
"provided_delay", provided_delay.
count()/1000)
560 ("provided_permissions", provided_permissions)
561 ("provided_keys", provided_keys)
562 ("delay_max_limit_ms", delay_max_limit.count()/1000)
563 );
564
565 }
566
567 if( !allow_unused_keys || check_but_dont_fail) {
568 SYS_ASSERT( checker.all_keys_used(), tx_irrelevant_sig,
569 "transaction bears irrelevant signatures from these keys: ${keys}",
570 ("keys", checker.unused_keys()) );
571 }
572 }
const generic_index< MultiIndexType > & get_index() const
std::optional< permission_name > lookup_minimum_permission(account_name authorizer_account, scope_name code_account, action_name type) const
Find the lowest authority level required for authorizer_account to authorize a message of the specifi...
void delay(websocketpp::connection_hdl, long duration)
chainbase::shared_multi_index_container< permission_object, indexed_by< ordered_unique< tag< by_id >, member< permission_object, permission_object::id_type, &permission_object::id > >, ordered_unique< tag< by_parent >, composite_key< permission_object, member< permission_object, permission_object::id_type, &permission_object::parent >, member< permission_object, permission_object::id_type, &permission_object::id > > >, ordered_unique< tag< by_owner >, composite_key< permission_object, member< permission_object, account_name, &permission_object::owner >, member< permission_object, permission_name, &permission_object::name > > >, ordered_unique< tag< by_name >, composite_key< permission_object, member< permission_object, permission_name, &permission_object::name >, member< permission_object, permission_object::id_type, &permission_object::id > > > > > permission_index
static action_name get_name()
static action_name get_name()
static action_name get_name()
static action_name get_name()
static action_name get_name()