Merge pull request #232 from oxarbitrage/issue230

Added withdraw permissions to get_full_account api function. requeste…
This commit is contained in:
Vikram Rajkumar 2017-02-09 15:12:38 -06:00 committed by GitHub
commit 73deff6a56
2 changed files with 11 additions and 1 deletions

View file

@ -607,6 +607,13 @@ std::map<std::string, full_account> database_api_impl::get_full_accounts( const
[&acnt] (const asset_object& asset) {
acnt.assets.emplace_back(asset.id);
});
// get withdraws permissions
auto withdraw_range = _db.get_index_type<withdraw_permission_index>().indices().get<by_from>().equal_range(account->id);
std::for_each(withdraw_range.first, withdraw_range.second,
[&acnt] (const withdraw_permission_object& withdraw) {
acnt.withdraws.emplace_back(withdraw);
});
results[account_name_or_id] = acnt;

View file

@ -26,6 +26,7 @@
#include <graphene/chain/account_object.hpp>
#include <graphene/chain/vesting_balance_object.hpp>
#include <graphene/chain/market_evaluator.hpp>
#include <graphene/chain/withdraw_permission_object.hpp>
namespace graphene { namespace app {
using namespace graphene::chain;
@ -44,7 +45,8 @@ namespace graphene { namespace app {
vector<limit_order_object> limit_orders;
vector<call_order_object> call_orders;
vector<proposal_object> proposals;
vector<asset_id_type> assets;
vector<asset_id_type> assets;
vector<withdraw_permission_object> withdraws;
};
} }
@ -63,4 +65,5 @@ FC_REFLECT( graphene::app::full_account,
(call_orders)
(proposals)
(assets)
(withdraws)
)