cli_wallet: Print operation results
This commit is contained in:
parent
0d55541682
commit
4fa0f182ec
1 changed files with 35 additions and 1 deletions
|
|
@ -73,6 +73,19 @@ namespace graphene { namespace wallet {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
|
struct operation_result_printer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
operation_result_printer( const wallet_api_impl& w )
|
||||||
|
: _wallet(w) {}
|
||||||
|
const wallet_api_impl& _wallet;
|
||||||
|
typedef std::string result_type;
|
||||||
|
|
||||||
|
std::string operator()(const void_result& x) const;
|
||||||
|
std::string operator()(const object_id_type& oid);
|
||||||
|
std::string operator()(const asset& a);
|
||||||
|
};
|
||||||
|
|
||||||
// BLOCK TRX OP VOP
|
// BLOCK TRX OP VOP
|
||||||
struct operation_printer
|
struct operation_printer
|
||||||
{
|
{
|
||||||
|
|
@ -2397,6 +2410,12 @@ std::string operation_printer::operator()(const T& op)const
|
||||||
out << op_name <<" ";
|
out << op_name <<" ";
|
||||||
// out << "balance delta: " << fc::json::to_string(acc.balance) <<" ";
|
// out << "balance delta: " << fc::json::to_string(acc.balance) <<" ";
|
||||||
out << payer.name << " fee: " << a.amount_to_pretty_string( op.fee );
|
out << payer.name << " fee: " << a.amount_to_pretty_string( op.fee );
|
||||||
|
operation_result_printer rprinter(wallet);
|
||||||
|
std::string str_result = result.visit(rprinter);
|
||||||
|
if( str_result != "" )
|
||||||
|
{
|
||||||
|
out << " result: " << str_result;
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
std::string operation_printer::operator()(const transfer_from_blind_operation& op)const
|
std::string operation_printer::operator()(const transfer_from_blind_operation& op)const
|
||||||
|
|
@ -2470,6 +2489,21 @@ std::string operation_printer::operator()(const asset_create_operation& op) cons
|
||||||
return fee(op.fee);
|
return fee(op.fee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string operation_result_printer::operator()(const void_result& x) const
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string operation_result_printer::operator()(const object_id_type& oid)
|
||||||
|
{
|
||||||
|
return std::string(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string operation_result_printer::operator()(const asset& a)
|
||||||
|
{
|
||||||
|
return _wallet.get_asset(a.asset_id).amount_to_pretty_string(a);
|
||||||
|
}
|
||||||
|
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue