diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index 5592cac9..9b3282c4 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -1310,11 +1310,15 @@ class wallet_api * @param owner_account the name or id of the account which is creating the SON * @param url a URL to include in the SON record in the blockchain. Clients may * display this when showing a list of SONs. May be blank. + * @param deposit_id vesting balance id for SON deposit + * @param pay_vb_id vesting balance id for SON pay_vb * @param broadcast true to broadcast the transaction on the network * @returns the signed transaction registering a SON */ signed_transaction create_son(string owner_account, string url, + vesting_balance_id_type deposit_id, + vesting_balance_id_type pay_vb_id, bool broadcast = false); /** diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index e9492132..d77a2a94 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -1860,6 +1860,8 @@ public: signed_transaction create_son(string owner_account, string url, + vesting_balance_id_type deposit_id, + vesting_balance_id_type pay_vb_id, bool broadcast /* = false */) { try { account_object son_account = get_account(owner_account); @@ -1872,6 +1874,8 @@ public: son_create_op.owner_account = son_account.id; son_create_op.signing_key = son_public_key; son_create_op.url = url; + son_create_op.deposit = deposit_id; + son_create_op.pay_vb = pay_vb_id; if (_remote_db->get_son_by_account(son_create_op.owner_account)) FC_THROW("Account ${owner_account} is already a SON", ("owner_account", owner_account)); @@ -4276,9 +4280,11 @@ signed_transaction wallet_api::create_vesting(string owner_account, signed_transaction wallet_api::create_son(string owner_account, string url, + vesting_balance_id_type deposit_id, + vesting_balance_id_type pay_vb_id, bool broadcast /* = false */) { - return my->create_son(owner_account, url, broadcast); + return my->create_son(owner_account, url, deposit_id, pay_vb_id, broadcast); } signed_transaction wallet_api::update_son(string owner_account, diff --git a/tests/cli/son.cpp b/tests/cli/son.cpp index b04b573a..1dfd8381 100644 --- a/tests/cli/son.cpp +++ b/tests/cli/son.cpp @@ -78,14 +78,20 @@ public: BOOST_CHECK(fixture_.generate_block()); // create deposit vesting - fixture_.con.wallet_api_ptr->create_vesting(account_name, "50", "son", true); + fixture_.con.wallet_api_ptr->create_vesting(account_name, "50000000", "son", true); BOOST_CHECK(fixture_.generate_block()); - // check deposit is here - auto deposits = fixture_.con.wallet_api_ptr->get_vesting_balances(account_name); - BOOST_CHECK(deposits.size() == 1); + // create pay_vb vesting + fixture_.con.wallet_api_ptr->create_vesting(account_name, "1000000", "normal", true); + BOOST_CHECK(fixture_.generate_block()); - create_tx = fixture_.con.wallet_api_ptr->create_son(account_name, son_url, true); + // check deposits are here + auto deposits = fixture_.con.wallet_api_ptr->get_vesting_balances(account_name); + BOOST_CHECK(deposits.size() == 2); + + create_tx = fixture_.con.wallet_api_ptr->create_son(account_name, son_url, + deposits[0].id, deposits[1].id, + true); if (generate_maintenance) BOOST_CHECK(fixture_.generate_maintenance_block());