forked from lthn/blockchain
few minor fixes
This commit is contained in:
parent
ec01f1c80b
commit
01548cdf57
3 changed files with 28 additions and 1 deletions
|
|
@ -1960,6 +1960,10 @@ bool simple_wallet::generate_ionic_swap_proposal(const std::vector<std::string>
|
|||
fail_msg_writer() << "Failed to load json file with asset specification: " << args[0];
|
||||
return true;
|
||||
}
|
||||
if (proposal_info.expiration_time == 0)
|
||||
{
|
||||
proposal_info.expiration_time = m_wallet->get_core_runtime_config().get_core_time() + 10 * 60;
|
||||
}
|
||||
currency::account_public_address destination_addr = AUTO_VAL_INIT(destination_addr);
|
||||
currency::payment_id_t integrated_payment_id;
|
||||
if (!m_wallet->get_transfer_address(args[1], destination_addr, integrated_payment_id))
|
||||
|
|
|
|||
|
|
@ -256,6 +256,7 @@ namespace wallet_public
|
|||
for (auto& st : subtransfers)
|
||||
{
|
||||
if (st.asset_id == currency::native_coin_asset_id)
|
||||
{
|
||||
if (st.is_income)
|
||||
{
|
||||
return st.amount;
|
||||
|
|
@ -263,7 +264,8 @@ namespace wallet_public
|
|||
else
|
||||
{
|
||||
throw std::runtime_error("Unexpected wallet_transfer_info: native is not income type");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
subtransfers.push_back(wallet_sub_transfer_info());
|
||||
subtransfers.back().is_income = true;
|
||||
|
|
|
|||
21
utils/test_api_files/ionic_swap_create_draft.json
Normal file
21
utils/test_api_files/ionic_swap_create_draft.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": "0",
|
||||
"method": "ionic_swap_generate_proposal",
|
||||
"params": {
|
||||
"proposal": {
|
||||
"to_bob": [{
|
||||
"asset_id": "e03a140b8447d2895290022b25c06bdabea514e2475ae56ce5bcbc554ab9865c",
|
||||
"amount": 2000000000000
|
||||
}],
|
||||
"to_alice": [{
|
||||
"asset_id": "d6329b5b1f7c0805b5c345f4957554002a2f557845f64d7645dae0e051a6498a",
|
||||
"amount": 10000000000000
|
||||
}],
|
||||
"mixins": 10,
|
||||
"fee_paid_by_a": 10000000000,
|
||||
"expiration_time": 0
|
||||
},
|
||||
"destination_address": "ZxDAcbaxXkyWRgYbeARBpngfmFat5TjDjjQA5NAbouB9eytwGWJqA5shAVYeCAHWPo254DF2o2X1td79PNvRr2Yc1b9Ep67ff"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue