From 9ac8bbe06a41be30ca4a9e548a32c79bbb641f9f Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Thu, 20 Feb 2020 02:28:53 +0100 Subject: [PATCH] Extend sidechain_address_object to contain withdrawal addresses - Withdrawal address is the address where system will send sidechain currencies --- .../chain/protocol/sidechain_address.hpp | 14 +- .../chain/sidechain_address_object.hpp | 25 ++-- .../chain/sidechain_address_evaluator.cpp | 10 +- .../sidechain_net_handler.hpp | 3 +- .../sidechain_net_handler.cpp | 126 +++++++++++++----- .../sidechain_net_handler_bitcoin.cpp | 2 +- .../sidechain_net_handler_peerplays.cpp | 17 +-- .../wallet/include/graphene/wallet/wallet.hpp | 20 ++- libraries/wallet/wallet.cpp | 34 ++--- tests/tests/sidechain_addresses_test.cpp | 25 ++-- 10 files changed, 160 insertions(+), 116 deletions(-) diff --git a/libraries/chain/include/graphene/chain/protocol/sidechain_address.hpp b/libraries/chain/include/graphene/chain/protocol/sidechain_address.hpp index d0e658b4..71dfea1e 100644 --- a/libraries/chain/include/graphene/chain/protocol/sidechain_address.hpp +++ b/libraries/chain/include/graphene/chain/protocol/sidechain_address.hpp @@ -12,9 +12,8 @@ namespace graphene { namespace chain { asset fee; account_id_type sidechain_address_account; graphene::peerplays_sidechain::sidechain_type sidechain; - string address; - string private_key; - string public_key; + string deposit_address; + string withdrawal_address; account_id_type fee_payer()const { return sidechain_address_account; } share_type calculate_fee(const fee_parameters_type& k)const { return 0; } @@ -28,9 +27,8 @@ namespace graphene { namespace chain { sidechain_address_id_type sidechain_address_id; account_id_type sidechain_address_account; graphene::peerplays_sidechain::sidechain_type sidechain; - optional address; - optional private_key; - optional public_key; + optional deposit_address; + optional withdrawal_address; account_id_type fee_payer()const { return sidechain_address_account; } share_type calculate_fee(const fee_parameters_type& k)const { return 0; } @@ -53,12 +51,12 @@ namespace graphene { namespace chain { FC_REFLECT(graphene::chain::sidechain_address_add_operation::fee_parameters_type, (fee) ) FC_REFLECT(graphene::chain::sidechain_address_add_operation, (fee) - (sidechain_address_account)(sidechain)(address)(private_key)(public_key) ) + (sidechain_address_account)(sidechain)(deposit_address)(withdrawal_address) ) FC_REFLECT(graphene::chain::sidechain_address_update_operation::fee_parameters_type, (fee) ) FC_REFLECT(graphene::chain::sidechain_address_update_operation, (fee) (sidechain_address_id) - (sidechain_address_account)(sidechain)(address)(private_key)(public_key) ) + (sidechain_address_account)(sidechain)(deposit_address)(withdrawal_address) ) FC_REFLECT(graphene::chain::sidechain_address_delete_operation::fee_parameters_type, (fee) ) FC_REFLECT(graphene::chain::sidechain_address_delete_operation, (fee) diff --git a/libraries/chain/include/graphene/chain/sidechain_address_object.hpp b/libraries/chain/include/graphene/chain/sidechain_address_object.hpp index 8c77fad2..8d45416f 100644 --- a/libraries/chain/include/graphene/chain/sidechain_address_object.hpp +++ b/libraries/chain/include/graphene/chain/sidechain_address_object.hpp @@ -21,21 +21,20 @@ namespace graphene { namespace chain { account_id_type sidechain_address_account; graphene::peerplays_sidechain::sidechain_type sidechain; - string address; - string private_key; - string public_key; + string deposit_address; + string withdrawal_address; sidechain_address_object() : sidechain(graphene::peerplays_sidechain::sidechain_type::bitcoin), - address(""), - private_key(""), - public_key("") {} + deposit_address(""), + withdrawal_address("") {} }; struct by_account; struct by_sidechain; struct by_account_and_sidechain; - struct by_sidechain_and_address; + struct by_sidechain_and_deposit_address; + struct by_sidechain_and_withdrawal_address; using sidechain_address_multi_index_type = multi_index_container< sidechain_address_object, indexed_by< @@ -54,10 +53,16 @@ namespace graphene { namespace chain { member > >, - ordered_unique< tag, + ordered_unique< tag, composite_key, - member + member + > + >, + ordered_unique< tag, + composite_key, + member > > > @@ -67,4 +72,4 @@ namespace graphene { namespace chain { } } // graphene::chain FC_REFLECT_DERIVED( graphene::chain::sidechain_address_object, (graphene::db::object), - (sidechain_address_account)(sidechain)(address)(private_key)(public_key) ) + (sidechain_address_account) (sidechain) (deposit_address) (withdrawal_address) ) diff --git a/libraries/chain/sidechain_address_evaluator.cpp b/libraries/chain/sidechain_address_evaluator.cpp index d79d4cb1..dff233b6 100644 --- a/libraries/chain/sidechain_address_evaluator.cpp +++ b/libraries/chain/sidechain_address_evaluator.cpp @@ -19,9 +19,8 @@ object_id_type add_sidechain_address_evaluator::do_apply(const sidechain_address const auto& new_sidechain_address_object = db().create( [&]( sidechain_address_object& obj ){ obj.sidechain_address_account = op.sidechain_address_account; obj.sidechain = op.sidechain; - obj.address = op.address; - obj.private_key = op.private_key; - obj.public_key = op.public_key; + obj.deposit_address = op.deposit_address; + obj.withdrawal_address = op.withdrawal_address; }); return new_sidechain_address_object.id; } FC_CAPTURE_AND_RETHROW( (op) ) } @@ -41,9 +40,8 @@ object_id_type update_sidechain_address_evaluator::do_apply(const sidechain_addr if(itr != idx.end()) { db().modify(*itr, [&op](sidechain_address_object &sao) { - if(op.address.valid()) sao.address = *op.address; - if(op.private_key.valid()) sao.private_key = *op.private_key; - if(op.public_key.valid()) sao.public_key = *op.public_key; + if(op.deposit_address.valid()) sao.deposit_address = *op.deposit_address; + if(op.withdrawal_address.valid()) sao.withdrawal_address = *op.withdrawal_address; }); } return op.sidechain_address_id; diff --git a/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler.hpp b/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler.hpp index 576b26ea..9c3c0590 100644 --- a/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler.hpp +++ b/libraries/plugins/peerplays_sidechain/include/graphene/peerplays_sidechain/sidechain_net_handler.hpp @@ -16,7 +16,8 @@ public: virtual ~sidechain_net_handler(); graphene::peerplays_sidechain::sidechain_type get_sidechain(); - std::vector get_sidechain_addresses(); + std::vector get_sidechain_deposit_addresses(); + std::vector get_sidechain_withdrawal_addresses(); void sidechain_event_data_received(const sidechain_event_data& sed); diff --git a/libraries/plugins/peerplays_sidechain/sidechain_net_handler.cpp b/libraries/plugins/peerplays_sidechain/sidechain_net_handler.cpp index a8aa5f81..5a2f9bb7 100644 --- a/libraries/plugins/peerplays_sidechain/sidechain_net_handler.cpp +++ b/libraries/plugins/peerplays_sidechain/sidechain_net_handler.cpp @@ -19,7 +19,7 @@ graphene::peerplays_sidechain::sidechain_type sidechain_net_handler::get_sidecha return sidechain; } -std::vector sidechain_net_handler::get_sidechain_addresses() { +std::vector sidechain_net_handler::get_sidechain_deposit_addresses() { std::vector result; switch (sidechain) { @@ -30,7 +30,29 @@ std::vector sidechain_net_handler::get_sidechain_addresses() { const auto& sidechain_addresses_by_sidechain_range = sidechain_addresses_by_sidechain_idx.equal_range(sidechain); std::for_each(sidechain_addresses_by_sidechain_range.first, sidechain_addresses_by_sidechain_range.second, [&result] (const sidechain_address_object& sao) { - result.push_back(sao.address); + result.push_back(sao.deposit_address); + }); + break; + } + default: + assert(false); + } + + return result; +} + +std::vector sidechain_net_handler::get_sidechain_withdrawal_addresses() { + std::vector result; + + switch (sidechain) { + case sidechain_type::bitcoin: + { + const auto& sidechain_addresses_idx = database.get_index_type(); + const auto& sidechain_addresses_by_sidechain_idx = sidechain_addresses_idx.indices().get(); + const auto& sidechain_addresses_by_sidechain_range = sidechain_addresses_by_sidechain_idx.equal_range(sidechain); + std::for_each(sidechain_addresses_by_sidechain_range.first, sidechain_addresses_by_sidechain_range.second, + [&result] (const sidechain_address_object& sao) { + result.push_back(sao.withdrawal_address); }); break; } @@ -57,39 +79,83 @@ void sidechain_net_handler::sidechain_event_data_received(const sidechain_event_ const chain::global_property_object& gpo = database.get_global_properties(); - son_wallet_deposit_create_operation op; - op.payer = GRAPHENE_SON_ACCOUNT; - op.timestamp = sed.timestamp; - op.sidechain = sed.sidechain; - op.sidechain_uid = sed.sidechain_uid; - op.sidechain_transaction_id = sed.sidechain_transaction_id; - op.sidechain_from = sed.sidechain_from; - op.sidechain_to = sed.sidechain_to; - op.sidechain_currency = sed.sidechain_currency; - op.sidechain_amount = sed.sidechain_amount; - op.peerplays_from = sed.peerplays_from; - op.peerplays_to = sed.peerplays_to; - op.peerplays_asset = sed.peerplays_asset; + // Deposit request + if ((sed.peerplays_to == GRAPHENE_SON_ACCOUNT) && (sed.sidechain_currency.compare("1.3.0") != 0)) { + son_wallet_deposit_create_operation op; + op.payer = GRAPHENE_SON_ACCOUNT; + op.timestamp = sed.timestamp; + op.sidechain = sed.sidechain; + op.sidechain_uid = sed.sidechain_uid; + op.sidechain_transaction_id = sed.sidechain_transaction_id; + op.sidechain_from = sed.sidechain_from; + op.sidechain_to = sed.sidechain_to; + op.sidechain_currency = sed.sidechain_currency; + op.sidechain_amount = sed.sidechain_amount; + op.peerplays_from = sed.peerplays_from; + op.peerplays_to = sed.peerplays_to; + op.peerplays_asset = sed.peerplays_asset; - for (son_id_type son_id : plugin.get_sons()) { - if (plugin.is_active_son(son_id)) { - proposal_create_operation proposal_op; - proposal_op.fee_paying_account = plugin.get_son_object(son_id).son_account; - proposal_op.proposed_ops.emplace_back( op_wrapper( op ) ); - uint32_t lifetime = ( gpo.parameters.block_interval * gpo.active_witnesses.size() ) * 3; - proposal_op.expiration_time = time_point_sec( database.head_block_time().sec_since_epoch() + lifetime ); + for (son_id_type son_id : plugin.get_sons()) { + if (plugin.is_active_son(son_id)) { + proposal_create_operation proposal_op; + proposal_op.fee_paying_account = plugin.get_son_object(son_id).son_account; + proposal_op.proposed_ops.emplace_back( op_wrapper( op ) ); + uint32_t lifetime = ( gpo.parameters.block_interval * gpo.active_witnesses.size() ) * 3; + proposal_op.expiration_time = time_point_sec( database.head_block_time().sec_since_epoch() + lifetime ); - ilog("sidechain_net_handler: sending proposal for son wallet transfer create operation by ${son}", ("son", son_id)); - signed_transaction trx = plugin.database().create_signed_transaction(plugin.get_private_key(son_id), proposal_op); - try { - database.push_transaction(trx, database::validation_steps::skip_block_size_check); - if(plugin.app().p2p_node()) - plugin.app().p2p_node()->broadcast(net::trx_message(trx)); - } catch(fc::exception e){ - ilog("sidechain_net_handler: sending proposal for son wallet transfer create operation by ${son} failed with exception ${e}", ("son", son_id) ("e", e.what())); + ilog("sidechain_net_handler: sending proposal for son wallet transfer create operation by ${son}", ("son", son_id)); + signed_transaction trx = plugin.database().create_signed_transaction(plugin.get_private_key(son_id), proposal_op); + try { + database.push_transaction(trx, database::validation_steps::skip_block_size_check); + if(plugin.app().p2p_node()) + plugin.app().p2p_node()->broadcast(net::trx_message(trx)); + } catch(fc::exception e){ + ilog("sidechain_net_handler: sending proposal for son wallet transfer create operation by ${son} failed with exception ${e}", ("son", son_id) ("e", e.what())); + } } } + return; } + + // Withdrawal request + if ((sed.peerplays_to == GRAPHENE_SON_ACCOUNT) && (sed.sidechain_currency.compare("1.3.0") == 0)) { + son_wallet_withdrawal_create_operation op; + op.payer = GRAPHENE_SON_ACCOUNT; + op.timestamp = sed.timestamp; + op.sidechain = sed.sidechain; + op.sidechain_uid = sed.sidechain_uid; + op.sidechain_transaction_id = sed.sidechain_transaction_id; + op.sidechain_from = sed.sidechain_from; + op.sidechain_to = sed.sidechain_to; + op.sidechain_currency = sed.sidechain_currency; + op.sidechain_amount = sed.sidechain_amount; + op.peerplays_from = sed.peerplays_from; + op.peerplays_to = sed.peerplays_to; + op.peerplays_asset = sed.peerplays_asset; + + for (son_id_type son_id : plugin.get_sons()) { + if (plugin.is_active_son(son_id)) { + proposal_create_operation proposal_op; + proposal_op.fee_paying_account = plugin.get_son_object(son_id).son_account; + proposal_op.proposed_ops.emplace_back( op_wrapper( op ) ); + uint32_t lifetime = ( gpo.parameters.block_interval * gpo.active_witnesses.size() ) * 3; + proposal_op.expiration_time = time_point_sec( database.head_block_time().sec_since_epoch() + lifetime ); + + ilog("sidechain_net_handler: sending proposal for son wallet transfer create operation by ${son}", ("son", son_id)); + signed_transaction trx = plugin.database().create_signed_transaction(plugin.get_private_key(son_id), proposal_op); + try { + database.push_transaction(trx, database::validation_steps::skip_block_size_check); + if(plugin.app().p2p_node()) + plugin.app().p2p_node()->broadcast(net::trx_message(trx)); + } catch(fc::exception e){ + ilog("sidechain_net_handler: sending proposal for son wallet transfer create operation by ${son} failed with exception ${e}", ("son", son_id) ("e", e.what())); + } + } + } + return; + } + + FC_ASSERT(false, "Invalid sidechain event"); } } } // graphene::peerplays_sidechain diff --git a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp index 868150f4..c2b53130 100644 --- a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp +++ b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_bitcoin.cpp @@ -447,7 +447,7 @@ void sidechain_net_handler_bitcoin::handle_event( const std::string& event_data if( block != "" ) { const auto& vins = extract_info_from_block( block ); - const auto& sidechain_addresses_idx = database.get_index_type().indices().get(); + const auto& sidechain_addresses_idx = database.get_index_type().indices().get(); for( const auto& v : vins ) { const auto& addr_itr = sidechain_addresses_idx.find(std::make_tuple(sidechain_type::bitcoin, v.address)); diff --git a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_peerplays.cpp b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_peerplays.cpp index 55df5afd..ae5931e5 100644 --- a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_peerplays.cpp +++ b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_peerplays.cpp @@ -71,19 +71,10 @@ void sidechain_net_handler_peerplays::on_block_applied(const signed_block& b) { sed.sidechain_to = fc::to_string(transfer_op.to.space_id) + "." + fc::to_string(transfer_op.to.type_id) + "." + fc::to_string((uint64_t)transfer_op.to.instance); sed.sidechain_currency = transfer_op.amount.asset_id(plugin.database()).symbol; sed.sidechain_amount = transfer_op.amount.amount; - if (transfer_op.amount.asset_id == asset_id_type(0)) { - // User is returning CORE/TEST to the SON wallet - // This is start of withdrawal process - // We need to return BTC - - } else { - // User deposits other Peerplays asset - // We need to pay CORE/TEST - sed.peerplays_from = transfer_op.from; - sed.peerplays_to = transfer_op.to; - // We should calculate exchange rate between CORE/TEST and other Peerplays asset - sed.peerplays_asset = asset(transfer_op.amount.amount); // It i 1:1 for now - } + sed.peerplays_from = transfer_op.from; + sed.peerplays_to = transfer_op.to; + // We should calculate exchange rate between CORE/TEST and other Peerplays asset + sed.peerplays_asset = asset(transfer_op.amount.amount / transfer_op.amount.asset_id(plugin.database()).options.core_exchange_rate.quote.amount); sidechain_event_data_received(sed); } } diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index bfe9ab35..0f28de61 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -1416,17 +1416,15 @@ class wallet_api * * @param account the name or id of the account who owns the address * @param sidechain a sidechain to whom address belongs - * @param address sidechain address - * @param private_key private key for sidechain address - * @param public_key public key for sidechain address + * @param deposit_address sidechain address for deposits + * @param withdrawal_address sidechain address for withdrawals * @param broadcast true to broadcast the transaction on the network * @returns the signed transaction adding sidechain address */ signed_transaction add_sidechain_address(string account, peerplays_sidechain::sidechain_type sidechain, - string address, - string private_key, - string public_key, + string deposit_address, + string withdrawal_address, bool broadcast = false); /** Updates existing sidechain address owned by the given account for a given sidechain. @@ -1435,17 +1433,15 @@ class wallet_api * * @param account the name or id of the account who owns the address * @param sidechain a sidechain to whom address belongs - * @param address sidechain address - * @param private_key private key for sidechain address - * @param public_key public key for sidechain address + * @param deposit_address sidechain address for deposits + * @param withdrawal_address sidechain address for withdrawals * @param broadcast true to broadcast the transaction on the network * @returns the signed transaction updating sidechain address */ signed_transaction update_sidechain_address(string account, peerplays_sidechain::sidechain_type sidechain, - string address, - string private_key, - string public_key, + string deposit_address, + string withdrawal_address, bool broadcast = false); /** Deletes existing sidechain address owned by the given account for a given sidechain. diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 194254be..195971ec 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -2022,9 +2022,8 @@ public: signed_transaction add_sidechain_address(string account, peerplays_sidechain::sidechain_type sidechain, - string address, - string private_key, - string public_key, + string deposit_address, + string withdrawal_address, bool broadcast /* = false */) { try { account_id_type sidechain_address_account_id = get_account_id(account); @@ -2032,9 +2031,8 @@ public: sidechain_address_add_operation op; op.sidechain_address_account = sidechain_address_account_id; op.sidechain = sidechain; - op.address = address; - op.private_key = private_key; - op.public_key = public_key; + op.deposit_address = deposit_address; + op.withdrawal_address = withdrawal_address; signed_transaction tx; tx.operations.push_back( op ); @@ -2046,9 +2044,8 @@ public: signed_transaction update_sidechain_address(string account, peerplays_sidechain::sidechain_type sidechain, - string address, - string private_key, - string public_key, + string deposit_address, + string withdrawal_address, bool broadcast /* = false */) { try { account_id_type sidechain_address_account_id = get_account_id(account); @@ -2060,9 +2057,8 @@ public: op.sidechain_address_id = sao->id; op.sidechain_address_account = sidechain_address_account_id; op.sidechain = sidechain; - op.address = address; - op.private_key = private_key; - op.public_key = public_key; + op.deposit_address = deposit_address; + op.withdrawal_address = withdrawal_address; signed_transaction tx; tx.operations.push_back( op ); @@ -4501,22 +4497,20 @@ vector> wallet_api::get_son_wallets(uint32_t limit) signed_transaction wallet_api::add_sidechain_address(string account, peerplays_sidechain::sidechain_type sidechain, - string address, - string private_key, - string public_key, + string deposit_address, + string withdrawal_address, bool broadcast /* = false */) { - return my->add_sidechain_address(account, sidechain, address, private_key, public_key, broadcast); + return my->add_sidechain_address(account, sidechain, deposit_address, withdrawal_address, broadcast); } signed_transaction wallet_api::update_sidechain_address(string account, peerplays_sidechain::sidechain_type sidechain, - string address, - string private_key, - string public_key, + string deposit_address, + string withdrawal_address, bool broadcast /* = false */) { - return my->update_sidechain_address(account, sidechain, address, private_key, public_key, broadcast); + return my->update_sidechain_address(account, sidechain, deposit_address, withdrawal_address, broadcast); } signed_transaction wallet_api::delete_sidechain_address(string account, diff --git a/tests/tests/sidechain_addresses_test.cpp b/tests/tests/sidechain_addresses_test.cpp index eef76784..6c712fdd 100644 --- a/tests/tests/sidechain_addresses_test.cpp +++ b/tests/tests/sidechain_addresses_test.cpp @@ -30,9 +30,8 @@ BOOST_AUTO_TEST_CASE( sidechain_address_add_test ) { op.sidechain_address_account = alice_id; op.sidechain = graphene::peerplays_sidechain::sidechain_type::bitcoin; - op.address = "address"; - op.private_key = "private_key"; - op.public_key = "public_key"; + op.deposit_address = "deposit_address"; + op.withdrawal_address = "withdrawal_address"; trx.operations.push_back(op); sign(trx, alice_private_key); @@ -48,9 +47,8 @@ BOOST_AUTO_TEST_CASE( sidechain_address_add_test ) { BOOST_REQUIRE( obj != idx.end() ); BOOST_CHECK( obj->sidechain_address_account == alice_id ); BOOST_CHECK( obj->sidechain == graphene::peerplays_sidechain::sidechain_type::bitcoin ); - BOOST_CHECK( obj->address == "address" ); - BOOST_CHECK( obj->private_key == "private_key" ); - BOOST_CHECK( obj->public_key == "public_key" ); + BOOST_CHECK( obj->deposit_address == "deposit_address" ); + BOOST_CHECK( obj->withdrawal_address == "withdrawal_address" ); } BOOST_AUTO_TEST_CASE( sidechain_address_update_test ) { @@ -66,9 +64,8 @@ BOOST_AUTO_TEST_CASE( sidechain_address_update_test ) { auto obj = idx.find( boost::make_tuple( alice_id, graphene::peerplays_sidechain::sidechain_type::bitcoin ) ); BOOST_REQUIRE( obj != idx.end() ); - std::string new_address = "new_address"; - std::string new_private_key = "new_private_key"; - std::string new_public_key = "new_public_key"; + std::string new_deposit_address = "new_deposit_address"; + std::string new_withdrawal_address = "new_withdrawal_address"; { BOOST_TEST_MESSAGE("Send sidechain_address_update_operation"); @@ -77,9 +74,8 @@ BOOST_AUTO_TEST_CASE( sidechain_address_update_test ) { op.sidechain_address_id = sidechain_address_id_type(0); op.sidechain_address_account = obj->sidechain_address_account; op.sidechain = obj->sidechain; - op.address = new_address; - op.private_key = new_private_key; - op.public_key = new_public_key; + op.deposit_address = new_deposit_address; + op.withdrawal_address = new_withdrawal_address; trx.operations.push_back(op); sign(trx, alice_private_key); @@ -96,9 +92,8 @@ BOOST_AUTO_TEST_CASE( sidechain_address_update_test ) { BOOST_REQUIRE( obj != idx.end() ); BOOST_CHECK( obj->sidechain_address_account == obj->sidechain_address_account ); BOOST_CHECK( obj->sidechain == obj->sidechain ); - BOOST_CHECK( obj->address == new_address ); - BOOST_CHECK( obj->private_key == new_private_key ); - BOOST_CHECK( obj->public_key == new_public_key ); + BOOST_CHECK( obj->deposit_address == new_deposit_address ); + BOOST_CHECK( obj->withdrawal_address == new_withdrawal_address ); } }