Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove not needed code form son cli wallet commands #181

Merged
merged 1 commit into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,9 +1872,6 @@ class wallet_api_impl
son_create_op.owner_account = son_account.id;
son_create_op.signing_key = son_public_key;
son_create_op.url = url;
secret_hash_type::encoder enc;
fc::raw::pack(enc, son_private_key);
fc::raw::pack(enc, secret_hash_type());

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));
Expand All @@ -1895,12 +1892,10 @@ class wallet_api_impl
bool broadcast /* = false */)
{ try {
son_object son = get_son(owner_account);
account_object son_account = get_account( son.son_account );
fc::ecc::private_key active_private_key = get_private_key_for_account(son_account);

son_update_operation son_update_op;
son_update_op.son_id = son.id;
son_update_op.owner_account = son_account.id;
son_update_op.owner_account = son.son_account;
if( url != "" )
son_update_op.new_url = url;
if( block_signing_key != "" ) {
Expand All @@ -1919,12 +1914,10 @@ class wallet_api_impl
bool broadcast /* = false */)
{ try {
son_object son = get_son(owner_account);
account_object son_account = get_account( son.son_account );
fc::ecc::private_key active_private_key = get_private_key_for_account(son_account);

son_delete_operation son_delete_op;
son_delete_op.son_id = son.id;
son_delete_op.owner_account = son_account.id;
son_delete_op.owner_account = son.son_account;

signed_transaction tx;
tx.operations.push_back( son_delete_op );
Expand Down
5 changes: 5 additions & 0 deletions tests/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,11 @@ BOOST_FIXTURE_TEST_CASE( cli_get_son, cli_fixture )
son_data = con.wallet_api_ptr->get_son("sonmember");
BOOST_CHECK(son_data.url == "http://sonmember_updated");

// delete SON
con.wallet_api_ptr->delete_son("sonmember", true);
auto res = con.wallet_api_ptr->list_sons("", 100);
BOOST_CHECK(res.find("sonmember") == res.end());

} catch( fc::exception& e ) {
edump((e.to_detail_string()));
throw;
Expand Down