2429 {
2430 get_account_results result;
2431 result.account_name =
params.account_name;
2432
2433 const auto&
d = db.
db();
2435
2438
2439 rm.get_account_limits( result.account_name, result.ram_quota, result.net_weight, result.cpu_weight );
2440
2441 const auto& accnt_obj = db.
get_account( result.account_name );
2442 const auto& accnt_metadata_obj = db.
db().
get<account_metadata_object,by_name>( result.account_name );
2443
2444 result.privileged = accnt_metadata_obj.is_privileged();
2445 result.last_code_update = accnt_metadata_obj.last_code_update;
2446 result.created = accnt_obj.creation_date;
2447
2449 result.net_limit = rm.get_account_net_limit_ex( result.account_name, greylist_limit).first;
2450 result.cpu_limit = rm.get_account_cpu_limit_ex( result.account_name, greylist_limit).first;
2451 result.ram_usage = rm.get_account_ram_usage( result.account_name );
2452
2453 if ( producer_plug ) {
2456 result.subjective_cpu_bill_limit = subjective_cpu_bill_limit;
2457 }
2458
2459 const auto linked_action_map = ([&](){
2461 auto iter = links.lower_bound( boost::make_tuple(
params.account_name ) );
2462
2463 std::multimap<name, linked_action> result;
2464 while (iter != links.end() && iter->account ==
params.account_name ) {
2465 auto action = iter->message_type.empty() ? std::optional<name>() :
std::optional<
name>(iter->message_type);
2466 result.emplace(std::make_pair(iter->required_permission, linked_action{iter->code, std::move(action)}));
2467 ++iter;
2468 }
2469
2470 return result;
2471 })();
2472
2473 auto get_linked_actions = [&](chain::name perm_name) {
2474 auto link_bounds = linked_action_map.equal_range(perm_name);
2475 auto linked_actions = std::vector<linked_action>();
2476 linked_actions.reserve(linked_action_map.count(perm_name));
2477 for (auto link = link_bounds.first; link != link_bounds.second; ++link) {
2478 linked_actions.push_back(link->second);
2479 }
2480 return linked_actions;
2481 };
2482
2484 auto perm = permissions.lower_bound( boost::make_tuple(
params.account_name ) );
2485 while( perm != permissions.end() && perm->owner ==
params.account_name ) {
2488
2489
2490 if( perm->parent._id ) {
2491 const auto*
p =
d.find<permission_object,by_id>( perm->parent );
2493 SYS_ASSERT(perm->owner ==
p->owner, invalid_parent_permission,
"Invalid parent permission");
2495 }
2496 }
2497
2498 auto linked_actions = get_linked_actions(perm->name);
2499
2500 result.permissions.push_back( permission{ perm->name, parent, perm->auth.to_authority(), std::move(linked_actions)} );
2501 ++perm;
2502 }
2503
2504
2505 result.sysio_any_linked_actions = get_linked_actions(chain::config::sysio_any_name);
2506
2507 const auto& code_account = db.
db().
get<account_object,by_name>( config::system_account_name );
2508
2509 abi_def abi;
2512
2513 const auto token_code = "sysio.token"_n;
2514
2516
2517 if (
params.expected_core_symbol)
2518 core_symbol = *(
params.expected_core_symbol);
2519
2520 const auto* t_id =
d.find<chain::table_id_object, chain::by_code_scope_table>(boost::make_tuple( token_code,
params.account_name,
"accounts"_n ));
2521 if( t_id != nullptr ) {
2523 auto it = idx.find(boost::make_tuple( t_id->id, core_symbol.to_symbol_code() ));
2524 if( it != idx.end() && it->value.size() >= sizeof(asset) ) {
2525 asset bal;
2528
2529 if( bal.get_symbol().valid() && bal.get_symbol() == core_symbol ) {
2530 result.core_liquid_balance = bal;
2531 }
2532 }
2533 }
2534
2535 t_id =
d.find<chain::table_id_object, chain::by_code_scope_table>(boost::make_tuple( config::system_account_name,
params.account_name,
"userres"_n ));
2536 if (t_id != nullptr) {
2538 auto it = idx.find(boost::make_tuple( t_id->id,
params.account_name.to_uint64_t() ));
2539 if ( it != idx.end() ) {
2540 vector<char> data;
2543 }
2544 }
2545
2546 t_id =
d.find<chain::table_id_object, chain::by_code_scope_table>(boost::make_tuple( config::system_account_name,
params.account_name,
"delband"_n ));
2547 if (t_id != nullptr) {
2549 auto it = idx.find(boost::make_tuple( t_id->id,
params.account_name.to_uint64_t() ));
2550 if ( it != idx.end() ) {
2551 vector<char> data;
2554 }
2555 }
2556
2557 t_id =
d.find<chain::table_id_object, chain::by_code_scope_table>(boost::make_tuple( config::system_account_name,
params.account_name,
"refunds"_n ));
2558 if (t_id != nullptr) {
2560 auto it = idx.find(boost::make_tuple( t_id->id,
params.account_name.to_uint64_t() ));
2561 if ( it != idx.end() ) {
2562 vector<char> data;
2565 }
2566 }
2567
2568 t_id =
d.find<chain::table_id_object, chain::by_code_scope_table>(boost::make_tuple( config::system_account_name, config::system_account_name,
"voters"_n ));
2569 if (t_id != nullptr) {
2571 auto it = idx.find(boost::make_tuple( t_id->id,
params.account_name.to_uint64_t() ));
2572 if ( it != idx.end() ) {
2573 vector<char> data;
2576 }
2577 }
2578
2579 t_id =
d.find<chain::table_id_object, chain::by_code_scope_table>(boost::make_tuple( config::system_account_name, config::system_account_name,
"rexbal"_n ));
2580 if (t_id != nullptr) {
2582 auto it = idx.find(boost::make_tuple( t_id->id,
params.account_name.to_uint64_t() ));
2583 if( it != idx.end() ) {
2584 vector<char> data;
2587 }
2588 }
2589 }
2590 return result;
2591}
const ObjectType & get(CompatibleKey &&key) const
uint32_t head_block_num() const
bool is_resource_greylisted(const account_name &name) const
const account_object & get_account(account_name n) const
time_point head_block_time() const
const resource_limits_manager & get_resource_limits_manager() const
controller_impl
static void copy_inline_row(const chain::key_value_object &obj, vector< char > &data)
chain::resource_limits::account_resource_limit account_resource_limit
chain::symbol extract_core_symbol() const
int64_t get_subjective_bill(const account_name &first_auth, const fc::time_point &now) const
static const Segment ds(Segment::ds)
void unpack(Stream &s, std::deque< T > &value)
chainbase::shared_multi_index_container< permission_link_object, indexed_by< ordered_unique< tag< by_id >, >, ordered_unique< tag< by_action_name >, composite_key< permission_link_object, BOOST_MULTI_INDEX_MEMBER(permission_link_object, account_name, account), BOOST_MULTI_INDEX_MEMBER(permission_link_object, account_name, code), > >, ordered_unique< tag< by_permission_name >, composite_key< permission_link_object, BOOST_MULTI_INDEX_MEMBER(permission_link_object, account_name, account), BOOST_MULTI_INDEX_MEMBER(permission_link_object, permission_name, required_permission), > > > > permission_link_index
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
chainbase::shared_multi_index_container< key_value_object, indexed_by< ordered_unique< tag< by_id >, member< key_value_object, key_value_object::id_type, &key_value_object::id > >, ordered_unique< tag< by_scope_primary >, composite_key< key_value_object, member< key_value_object, table_id, &key_value_object::t_id >, member< key_value_object, uint64_t, &key_value_object::primary_key > >, composite_key_compare< std::less< table_id >, std::less< uint64_t > > > > > key_value_index
int64_t used
quantity used in current window