提交 39c7151f 编写于 作者: D Daniel Larimer

update info returned by git account to include properly formatted EOS and accurate parent authority

上级 2c08d520
......@@ -306,16 +306,21 @@ read_only::get_account_results read_only::get_account( const get_account_params&
result.abi = std::move(abi);
}
result.eos_balance = balance.balance;
result.staked_balance = staked_balance.stakedBalance;
result.unstaking_balance = staked_balance.unstakingBalance;
result.eos_balance = Asset(balance.balance, EOS_SYMBOL);
result.staked_balance = Asset(staked_balance.stakedBalance);
result.unstaking_balance = Asset(staked_balance.unstakingBalance);
result.last_unstaking_time = staked_balance.lastUnstakingTime;
const auto& permissions = d.get_index<permission_index,by_owner>();
auto perm = permissions.lower_bound( boost::make_tuple( params.name ) );
while( perm != permissions.end() && perm->owner == params.name ) {
/// TODO: lookup perm->parent name
result.permissions.push_back( permission{ perm->name, perm->name, perm->auth.to_authority() } );
Name parent;
const auto* p = d.find<permission_object,by_id>( perm->parent );
if( p ) parent = p->name;
result.permissions.push_back( permission{ perm->name, parent, perm->auth.to_authority() } );
++perm;
}
......
......@@ -20,6 +20,7 @@ namespace eos {
using chain::public_key_type;
using fc::optional;
using boost::container::flat_set;
using chain::Asset;
namespace chain_apis {
struct empty{};
......@@ -64,9 +65,9 @@ public:
struct get_account_results {
Name name;
uint64_t eos_balance = 0;
uint64_t staked_balance = 0;
uint64_t unstaking_balance = 0;
Asset eos_balance = Asset(0,EOS_SYMBOL);
Asset staked_balance;
Asset unstaking_balance;
fc::time_point_sec last_unstaking_time;
vector<permission> permissions;
optional<producer_info> producer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册