Withdrawal refactoring

This commit is contained in:
Srdjan Obucina 2020-02-20 23:43:37 +01:00
parent 4a7e70c8d6
commit b3904bb2e6
6 changed files with 22 additions and 0 deletions

View file

@ -23,7 +23,9 @@ public:
virtual void recreate_primary_wallet() = 0;
virtual void process_deposits() = 0;
virtual void process_deposit(const son_wallet_deposit_object& swdo) = 0;
virtual void process_withdrawals() = 0;
virtual void process_withdrawal(const son_wallet_withdraw_object& swwo) = 0;
protected:
peerplays_sidechain_plugin& plugin;

View file

@ -72,7 +72,9 @@ public:
void recreate_primary_wallet();
void process_deposits();
void process_deposit(const son_wallet_deposit_object& swdo);
void process_withdrawals();
void process_withdrawal(const son_wallet_withdraw_object& swwo);
std::string create_multisignature_wallet( const std::vector<std::string> public_keys );
std::string transfer( const std::string& from, const std::string& to, const uint64_t amount );

View file

@ -15,7 +15,9 @@ public:
void recreate_primary_wallet();
void process_deposits();
void process_deposit(const son_wallet_deposit_object& swdo);
void process_withdrawals();
void process_withdrawal(const son_wallet_withdraw_object& swwo);
std::string create_multisignature_wallet( const std::vector<std::string> public_keys );
std::string transfer( const std::string& from, const std::string& to, const uint64_t amount );

View file

@ -158,6 +158,8 @@ void sidechain_net_handler::process_deposits() {
std::for_each(idx_range.first, idx_range.second,
[&] (const son_wallet_deposit_object& swdo) {
process_deposit(swdo);
const chain::global_property_object& gpo = plugin.database().get_global_properties();
for (son_id_type son_id : plugin.get_sons()) {
@ -196,6 +198,8 @@ void sidechain_net_handler::process_withdrawals() {
std::for_each(idx_range.first, idx_range.second,
[&] (const son_wallet_withdraw_object& swwo) {
process_withdrawal(swwo);
const chain::global_property_object& gpo = plugin.database().get_global_properties();
for (son_id_type son_id : plugin.get_sons()) {

View file

@ -428,10 +428,16 @@ void sidechain_net_handler_bitcoin::process_deposits() {
sidechain_net_handler::process_deposits();
}
void sidechain_net_handler_bitcoin::process_deposit(const son_wallet_deposit_object& swdo) {
}
void sidechain_net_handler_bitcoin::process_withdrawals() {
sidechain_net_handler::process_withdrawals();
}
void sidechain_net_handler_bitcoin::process_withdrawal(const son_wallet_withdraw_object& swwo) {
}
std::string sidechain_net_handler_bitcoin::create_multisignature_wallet( const std::vector<std::string> public_keys ) {
return bitcoin_client->add_multisig_address(public_keys);
}

View file

@ -35,10 +35,16 @@ void sidechain_net_handler_peerplays::process_deposits() {
sidechain_net_handler::process_deposits();
}
void sidechain_net_handler_peerplays::process_deposit(const son_wallet_deposit_object& swdo) {
}
void sidechain_net_handler_peerplays::process_withdrawals() {
sidechain_net_handler::process_withdrawals();
}
void sidechain_net_handler_peerplays::process_withdrawal(const son_wallet_withdraw_object& swwo) {
}
std::string sidechain_net_handler_peerplays::create_multisignature_wallet( const std::vector<std::string> public_keys ) {
return "";
}