Withdrawal refactoring
This commit is contained in:
parent
4a7e70c8d6
commit
b3904bb2e6
6 changed files with 22 additions and 0 deletions
|
|
@ -23,7 +23,9 @@ public:
|
||||||
|
|
||||||
virtual void recreate_primary_wallet() = 0;
|
virtual void recreate_primary_wallet() = 0;
|
||||||
virtual void process_deposits() = 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_withdrawals() = 0;
|
||||||
|
virtual void process_withdrawal(const son_wallet_withdraw_object& swwo) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
peerplays_sidechain_plugin& plugin;
|
peerplays_sidechain_plugin& plugin;
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,9 @@ public:
|
||||||
|
|
||||||
void recreate_primary_wallet();
|
void recreate_primary_wallet();
|
||||||
void process_deposits();
|
void process_deposits();
|
||||||
|
void process_deposit(const son_wallet_deposit_object& swdo);
|
||||||
void process_withdrawals();
|
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 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 );
|
std::string transfer( const std::string& from, const std::string& to, const uint64_t amount );
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ public:
|
||||||
|
|
||||||
void recreate_primary_wallet();
|
void recreate_primary_wallet();
|
||||||
void process_deposits();
|
void process_deposits();
|
||||||
|
void process_deposit(const son_wallet_deposit_object& swdo);
|
||||||
void process_withdrawals();
|
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 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 );
|
std::string transfer( const std::string& from, const std::string& to, const uint64_t amount );
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,8 @@ void sidechain_net_handler::process_deposits() {
|
||||||
std::for_each(idx_range.first, idx_range.second,
|
std::for_each(idx_range.first, idx_range.second,
|
||||||
[&] (const son_wallet_deposit_object& swdo) {
|
[&] (const son_wallet_deposit_object& swdo) {
|
||||||
|
|
||||||
|
process_deposit(swdo);
|
||||||
|
|
||||||
const chain::global_property_object& gpo = plugin.database().get_global_properties();
|
const chain::global_property_object& gpo = plugin.database().get_global_properties();
|
||||||
|
|
||||||
for (son_id_type son_id : plugin.get_sons()) {
|
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,
|
std::for_each(idx_range.first, idx_range.second,
|
||||||
[&] (const son_wallet_withdraw_object& swwo) {
|
[&] (const son_wallet_withdraw_object& swwo) {
|
||||||
|
|
||||||
|
process_withdrawal(swwo);
|
||||||
|
|
||||||
const chain::global_property_object& gpo = plugin.database().get_global_properties();
|
const chain::global_property_object& gpo = plugin.database().get_global_properties();
|
||||||
|
|
||||||
for (son_id_type son_id : plugin.get_sons()) {
|
for (son_id_type son_id : plugin.get_sons()) {
|
||||||
|
|
|
||||||
|
|
@ -428,10 +428,16 @@ void sidechain_net_handler_bitcoin::process_deposits() {
|
||||||
sidechain_net_handler::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() {
|
void sidechain_net_handler_bitcoin::process_withdrawals() {
|
||||||
sidechain_net_handler::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 ) {
|
std::string sidechain_net_handler_bitcoin::create_multisignature_wallet( const std::vector<std::string> public_keys ) {
|
||||||
return bitcoin_client->add_multisig_address(public_keys);
|
return bitcoin_client->add_multisig_address(public_keys);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,16 @@ void sidechain_net_handler_peerplays::process_deposits() {
|
||||||
sidechain_net_handler::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() {
|
void sidechain_net_handler_peerplays::process_withdrawals() {
|
||||||
sidechain_net_handler::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 ) {
|
std::string sidechain_net_handler_peerplays::create_multisignature_wallet( const std::vector<std::string> public_keys ) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue