Compare commits
45 commits
master
...
feature/re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4647044ab3 | ||
|
|
a73ba73aaf | ||
|
|
b6b5893979 | ||
|
|
c5953c542c | ||
|
|
1e84ce51de | ||
|
|
902f76a093 | ||
|
|
24dbcc628e | ||
|
|
e24de4f199 | ||
|
|
15ebbfe6bb | ||
|
|
917e09a80b | ||
|
|
646b421308 | ||
|
|
dd2a531364 | ||
|
|
ae0a895daf | ||
|
|
8530228189 | ||
|
|
85fb3fee67 | ||
|
|
2c9fd332d4 | ||
|
|
fb01043e55 | ||
|
|
a1186372d2 | ||
|
|
3a51723e51 | ||
|
|
f23244cde0 | ||
|
|
fee7bc99fa | ||
|
|
6cf31b1075 | ||
|
|
97eaf4575a | ||
|
|
d367c308b8 | ||
|
|
838a9820f1 | ||
|
|
3e1f38d972 | ||
|
|
dfd3dfae09 | ||
|
|
1f72b4fbd6 | ||
|
|
3ee2439d5b | ||
|
|
cfecfb457b | ||
|
|
25bbacaa88 | ||
|
|
0175a7d0ec | ||
|
|
fd492ca196 | ||
|
|
2a6c917e4c | ||
|
|
6fe15f27b0 | ||
|
|
d2374aeed9 | ||
|
|
6f792db52d | ||
|
|
1b61016693 | ||
|
|
0f375777c2 | ||
|
|
a2ce65e1ef | ||
|
|
432876a677 | ||
|
|
948e7dd5e4 | ||
|
|
b21f9c4282 | ||
|
|
1586531e13 | ||
|
|
8e0e20eb6f |
24 changed files with 300 additions and 331 deletions
|
|
@ -156,16 +156,14 @@ test-e2e:
|
|||
- docker pull $IMAGE
|
||||
- docker tag $IMAGE peerplays-base:latest
|
||||
- docker image ls -a
|
||||
- docker-compose build
|
||||
- python3 main.py --start all
|
||||
- docker ps -a
|
||||
- python3 -m pytest test_btc_init_state.py test_hive_inital_state.py test_pp_inital_state.py
|
||||
- python3 main.py --stop
|
||||
- deactivate
|
||||
- docker ps -a
|
||||
after_script:
|
||||
- docker rmi $(docker images -a | grep -v 'hive-for-peerplays\|ethereum-for-peerplays\|bitcoin-for-peerplays\|ubuntu-for-peerplays' | awk '{print $3}')
|
||||
- cd peerplays-utils/peerplays-qa-environment/e2e-tests
|
||||
- docker-compose down
|
||||
- docker rmi -f $(docker images -a | grep -v 'hive-for-peerplays\|ethereum-for-peerplays\|bitcoin-for-peerplays\|ubuntu-for-peerplays\|peerplays-base\|IMAGE' | awk '{print $3}')
|
||||
tags:
|
||||
- python-tests
|
||||
when:
|
||||
manual
|
||||
|
|
|
|||
|
|
@ -134,8 +134,11 @@ RUN \
|
|||
libsodium-dev
|
||||
|
||||
RUN \
|
||||
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git && \
|
||||
cd libbitcoin-explorer && \
|
||||
git clone https://github.com/libbitcoin/libbitcoin-build.git && \
|
||||
cd libbitcoin-build && \
|
||||
git reset --hard 92c215fc1ffa272bab4d485d369d0306db52d69d && \
|
||||
./generate3.sh && \
|
||||
cd ../libbitcoin-explorer && \
|
||||
./install.sh && \
|
||||
ldconfig && \
|
||||
rm -rf /home/peerplays/src/*
|
||||
|
|
|
|||
|
|
@ -134,8 +134,11 @@ RUN \
|
|||
libsodium-dev
|
||||
|
||||
RUN \
|
||||
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git && \
|
||||
cd libbitcoin-explorer && \
|
||||
git clone https://github.com/libbitcoin/libbitcoin-build.git && \
|
||||
cd libbitcoin-build && \
|
||||
git reset --hard 92c215fc1ffa272bab4d485d369d0306db52d69d && \
|
||||
./generate3.sh && \
|
||||
cd ../libbitcoin-explorer && \
|
||||
./install.sh && \
|
||||
ldconfig && \
|
||||
rm -rf /home/peerplays/src/*
|
||||
|
|
|
|||
|
|
@ -77,8 +77,11 @@ sudo ldconfig
|
|||
|
||||
libbitcoin-explorer setup:
|
||||
```
|
||||
git clone --branch version3.8.0 --depth 1 https://gitlab.com/PBSA/peerplays-1.0/libbitcoin-explorer.git
|
||||
cd libbitcoin-explorer
|
||||
git clone https://github.com/libbitcoin/libbitcoin-build.git
|
||||
cd libbitcoin-build
|
||||
git reset --hard 92c215fc1ffa272bab4d485d369d0306db52d69d
|
||||
./generate3.sh
|
||||
cd ../libbitcoin-explorer
|
||||
sudo ./install.sh
|
||||
sudo ldconfig
|
||||
```
|
||||
|
|
|
|||
|
|
@ -733,7 +733,7 @@ public:
|
|||
low_block_num += (true_high_block_num - low_block_num + 2) / 2;
|
||||
} while (low_block_num <= high_block_num);
|
||||
|
||||
// idump((synopsis));
|
||||
//idump((synopsis));
|
||||
return synopsis;
|
||||
}
|
||||
FC_CAPTURE_AND_RETHROW()
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ public:
|
|||
uint32_t api_limit_get_trade_history = 100;
|
||||
uint32_t api_limit_get_trade_history_by_sequence = 100;
|
||||
|
||||
// private:
|
||||
//private:
|
||||
const account_object *get_account_from_string(const std::string &name_or_id,
|
||||
bool throw_if_not_found = true) const;
|
||||
const asset_object *get_asset_from_string(const std::string &symbol_or_id,
|
||||
|
|
@ -470,7 +470,7 @@ void database_api::set_subscribe_callback(std::function<void(const variant &)> c
|
|||
}
|
||||
|
||||
void database_api_impl::set_subscribe_callback(std::function<void(const variant &)> cb, bool notify_remove_create) {
|
||||
// edump((clear_filter));
|
||||
//edump((clear_filter));
|
||||
_subscribe_callback = cb;
|
||||
_notify_remove_create = notify_remove_create;
|
||||
_subscribed_accounts.clear();
|
||||
|
|
@ -2197,7 +2197,7 @@ vector<variant> database_api_impl::lookup_vote_ids(const vector<vote_id_type> &v
|
|||
case vote_id_type::committee: {
|
||||
auto itr = committee_idx.find(id);
|
||||
if (itr != committee_idx.end())
|
||||
result.emplace_back(variant(*itr, 2)); // Depth of committee_member_object is 1, add 1 to be safe
|
||||
result.emplace_back(variant(*itr, 1));
|
||||
else
|
||||
result.emplace_back(variant());
|
||||
break;
|
||||
|
|
@ -2205,7 +2205,7 @@ vector<variant> database_api_impl::lookup_vote_ids(const vector<vote_id_type> &v
|
|||
case vote_id_type::witness: {
|
||||
auto itr = witness_idx.find(id);
|
||||
if (itr != witness_idx.end())
|
||||
result.emplace_back(variant(*itr, 2)); // Depth of witness_object is 1, add 1 here to be safe
|
||||
result.emplace_back(variant(*itr, 1));
|
||||
else
|
||||
result.emplace_back(variant());
|
||||
break;
|
||||
|
|
@ -2213,15 +2213,11 @@ vector<variant> database_api_impl::lookup_vote_ids(const vector<vote_id_type> &v
|
|||
case vote_id_type::worker: {
|
||||
auto itr = for_worker_idx.find(id);
|
||||
if (itr != for_worker_idx.end()) {
|
||||
result.emplace_back(variant(*itr, 4)); // Depth of worker_object is 3, add 1 here to be safe.
|
||||
// If we want to extract the balance object inside,
|
||||
// need to increase this value
|
||||
result.emplace_back(variant(*itr, 1));
|
||||
} else {
|
||||
auto itr = against_worker_idx.find(id);
|
||||
if (itr != against_worker_idx.end()) {
|
||||
result.emplace_back(variant(*itr, 4)); // Depth of worker_object is 3, add 1 here to be safe.
|
||||
// If we want to extract the balance object inside,
|
||||
// need to increase this value
|
||||
result.emplace_back(variant(*itr, 1));
|
||||
} else {
|
||||
result.emplace_back(variant());
|
||||
}
|
||||
|
|
@ -2907,7 +2903,7 @@ graphene::app::gpos_info database_api::get_gpos_info(const account_id_type accou
|
|||
}
|
||||
|
||||
graphene::app::gpos_info database_api_impl::get_gpos_info(const account_id_type account) const {
|
||||
FC_ASSERT(_db.head_block_time() > HARDFORK_GPOS_TIME); // Can be deleted after GPOS hardfork time
|
||||
FC_ASSERT(_db.head_block_time() > HARDFORK_GPOS_TIME); //Can be deleted after GPOS hardfork time
|
||||
gpos_info result;
|
||||
|
||||
result.vesting_factor = _db.calculate_vesting_factor(account(_db));
|
||||
|
|
@ -3554,8 +3550,8 @@ void database_api_impl::handle_object_changed(bool force_notify, bool full_objec
|
|||
/// pushing the future back / popping the prior future if it is complete.
|
||||
/// if a connection hangs then this could get backed up and result in
|
||||
/// a failure to exit cleanly.
|
||||
// fc::async([capture_this,this,updates,market_broadcast_queue](){
|
||||
// if( _subscribe_callback )
|
||||
//fc::async([capture_this,this,updates,market_broadcast_queue](){
|
||||
//if( _subscribe_callback )
|
||||
// _subscribe_callback( updates );
|
||||
|
||||
for (auto id : ids) {
|
||||
|
|
|
|||
|
|
@ -386,14 +386,23 @@ vector<uint64_t> database::get_random_numbers(uint64_t minimum, uint64_t maximum
|
|||
|
||||
bool database::is_asset_creation_allowed(const string &symbol)
|
||||
{
|
||||
time_point_sec now = head_block_time();
|
||||
std::unordered_set<std::string> post_son_hf_symbols = {"ETH", "USDT", "BNB", "ADA", "DOGE", "XRP", "USDC", "DOT", "UNI", "BUSD", "BCH", "LTC", "SOL", "LINK", "MATIC", "THETA",
|
||||
"WBTC", "XLM", "ICP", "DAI", "VET", "ETC", "TRX", "FIL", "XMR", "EGR", "EOS", "SHIB", "AAVE", "CRO", "ALGO", "AMP", "BTCB",
|
||||
"BSV", "KLAY", "CAKE", "FTT", "LEO", "XTZ", "TFUEL", "MIOTA", "LUNA", "NEO", "ATOM", "MKR", "FEI", "WBNB", "UST", "AVAX",
|
||||
"STEEM", "HIVE", "HBD", "SBD", "BTS"};
|
||||
if (symbol == "BTC")
|
||||
{
|
||||
if (head_block_time() < HARDFORK_SON_TIME)
|
||||
if (now < HARDFORK_SON_TIME)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (post_son_hf_symbols.find(symbol) != post_son_hf_symbols.end())
|
||||
{
|
||||
if (now >= HARDFORK_SON_TIME)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} }
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ struct worker_pay_visitor
|
|||
worker.pay_worker(pay, db);
|
||||
}
|
||||
};
|
||||
|
||||
void database::update_worker_votes()
|
||||
{
|
||||
auto& idx = get_index_type<worker_index>();
|
||||
|
|
@ -186,28 +185,6 @@ void database::update_worker_votes()
|
|||
}
|
||||
}
|
||||
|
||||
void database::hotfix_2024()
|
||||
{
|
||||
if (head_block_time() >= HARDFORK_HOTFIX_2024_TIME)
|
||||
{
|
||||
if (get_chain_id().str() == "6b6b5f0ce7a36d323768e534f3edb41c6d6332a541a95725b98e28d140850134")
|
||||
{
|
||||
const auto& vb_idx = get_index_type<vesting_balance_index>().indices().get<by_id>();
|
||||
auto vbo = vb_idx.find(vesting_balance_id_type(388));
|
||||
if (vbo != vb_idx.end())
|
||||
{
|
||||
if (vbo->owner == account_id_type(14786))
|
||||
{
|
||||
modify(*vbo, [&]( vesting_balance_object& _vbo)
|
||||
{
|
||||
_vbo.owner = account_id_type(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void database::pay_sons_before_hf_ethereum()
|
||||
{
|
||||
const auto now = head_block_time();
|
||||
|
|
@ -2306,7 +2283,7 @@ void database::perform_son_tasks()
|
|||
// Add vote_ids for HIVE and ETHEREUM to all existing SONs
|
||||
const auto &all_sons = get_index_type<son_index>().indices().get<by_id>();
|
||||
for (const son_object &son : all_sons) {
|
||||
const auto existing_vote_id_bitcoin = son.get_bitcoin_vote_id();
|
||||
vote_id_type existing_vote_id_bitcoin;
|
||||
vote_id_type new_vote_id_hive;
|
||||
vote_id_type new_vote_id_eth;
|
||||
|
||||
|
|
@ -2323,7 +2300,7 @@ void database::perform_son_tasks()
|
|||
// Duplicate all votes from bitcoin to hive
|
||||
const auto &all_accounts = get_index_type<account_index>().indices().get<by_id>();
|
||||
for (const auto &account : all_accounts) {
|
||||
if (existing_vote_id_bitcoin.valid() && account.options.votes.count(*existing_vote_id_bitcoin) != 0) {
|
||||
if (account.options.votes.count(existing_vote_id_bitcoin) != 0) {
|
||||
modify(account, [new_vote_id_hive](account_object &a) {
|
||||
a.options.votes.insert(new_vote_id_hive);
|
||||
});
|
||||
|
|
@ -2533,7 +2510,6 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g
|
|||
update_active_committee_members();
|
||||
update_active_sons();
|
||||
update_worker_votes();
|
||||
hotfix_2024();
|
||||
|
||||
const dynamic_global_property_object& dgpo = get_dynamic_global_properties();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
#ifndef HARDFORK_HOTFIX_2024_TIME
|
||||
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||
#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00"))
|
||||
#else
|
||||
#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00"))
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -2,6 +2,6 @@
|
|||
#ifdef BUILD_PEERPLAYS_TESTNET
|
||||
#define HARDFORK_SON_FOR_ETHEREUM_TIME (fc::time_point_sec::from_iso_string("2023-07-17T12:00:00"))
|
||||
#else
|
||||
#define HARDFORK_SON_FOR_ETHEREUM_TIME (fc::time_point_sec::from_iso_string("2023-10-24T12:00:00"))
|
||||
#define HARDFORK_SON_FOR_ETHEREUM_TIME (fc::time_point_sec::from_iso_string("2023-07-31T12:00:00"))
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@
|
|||
#define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4
|
||||
#define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3
|
||||
|
||||
#define GRAPHENE_CURRENT_DB_VERSION "PPY2.5"
|
||||
#define GRAPHENE_CURRENT_DB_VERSION "PPY2.4"
|
||||
|
||||
#define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT)
|
||||
|
||||
|
|
|
|||
|
|
@ -594,7 +594,6 @@ namespace graphene { namespace chain {
|
|||
const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
||||
void update_son_wallet( const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
||||
void update_worker_votes();
|
||||
void hotfix_2024();
|
||||
|
||||
public:
|
||||
double calculate_vesting_factor(const account_object& stake_account);
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ void bitcoin_transaction_builder::add_in(payment_type type, tx_in txin, const by
|
|||
txin.scriptSig = script_code;
|
||||
break;
|
||||
default: {
|
||||
if (txin.prevout.hash == fc::sha256("0000000000000000000000000000000000000000000000000000000000000000")) { // coinbase
|
||||
if (txin.prevout.hash == fc::sha256("0000000000000000000000000000000000000000000000000000000000000000")) { //coinbase
|
||||
FC_ASSERT(script_code != bytes());
|
||||
txin.scriptSig = script_code;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ rpc_client::~rpc_client() {
|
|||
if (connection_selection_task.valid())
|
||||
connection_selection_task.cancel_and_wait(__FUNCTION__);
|
||||
} catch (fc::canceled_exception &) {
|
||||
// Expected exception. Move along.
|
||||
//Expected exception. Move along.
|
||||
} catch (fc::exception &e) {
|
||||
edump((e.to_detail_string()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,15 +22,15 @@ typedef fc::ecc::private_key private_key_type;
|
|||
typedef fc::sha256 chain_id_type;
|
||||
typedef std::string account_name_type;
|
||||
typedef fc::ripemd160 block_id_type;
|
||||
// typedef fc::ripemd160 checksum_type;
|
||||
//typedef fc::ripemd160 checksum_type;
|
||||
typedef fc::ripemd160 transaction_id_type;
|
||||
typedef fc::sha256 digest_type;
|
||||
typedef fc::ecc::compact_signature signature_type;
|
||||
typedef fc::safe<int64_t> share_type;
|
||||
// typedef safe<uint64_t> ushare_type;
|
||||
// typedef uint16_t weight_type;
|
||||
// typedef uint32_t contribution_id_type;
|
||||
// typedef fixed_string<32> custom_id_type;
|
||||
//typedef safe<uint64_t> ushare_type;
|
||||
//typedef uint16_t weight_type;
|
||||
//typedef uint32_t contribution_id_type;
|
||||
//typedef fixed_string<32> custom_id_type;
|
||||
|
||||
struct public_key_type {
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,6 @@ private:
|
|||
uint16_t retries_threshold = 150;
|
||||
|
||||
bool first_block_skipped;
|
||||
bool son_processing_enabled;
|
||||
void on_applied_block(const signed_block &b);
|
||||
};
|
||||
|
||||
|
|
@ -136,8 +135,7 @@ peerplays_sidechain_plugin_impl::peerplays_sidechain_plugin_impl(peerplays_sidec
|
|||
}
|
||||
return net_handlers;
|
||||
}()),
|
||||
first_block_skipped(false),
|
||||
son_processing_enabled(false) {
|
||||
first_block_skipped(false) {
|
||||
}
|
||||
|
||||
peerplays_sidechain_plugin_impl::~peerplays_sidechain_plugin_impl() {
|
||||
|
|
@ -145,7 +143,7 @@ peerplays_sidechain_plugin_impl::~peerplays_sidechain_plugin_impl() {
|
|||
if (_heartbeat_task.valid())
|
||||
_heartbeat_task.cancel_and_wait(__FUNCTION__);
|
||||
} catch (fc::canceled_exception &) {
|
||||
// Expected exception. Move along.
|
||||
//Expected exception. Move along.
|
||||
} catch (fc::exception &e) {
|
||||
edump((e.to_detail_string()));
|
||||
}
|
||||
|
|
@ -156,7 +154,7 @@ peerplays_sidechain_plugin_impl::~peerplays_sidechain_plugin_impl() {
|
|||
_son_processing_task.at(active_sidechain_type).wait();
|
||||
}
|
||||
} catch (fc::canceled_exception &) {
|
||||
// Expected exception. Move along.
|
||||
//Expected exception. Move along.
|
||||
} catch (fc::exception &e) {
|
||||
edump((e.to_detail_string()));
|
||||
}
|
||||
|
|
@ -540,11 +538,11 @@ void peerplays_sidechain_plugin_impl::son_processing(sidechain_type sidechain) {
|
|||
return;
|
||||
}
|
||||
|
||||
// fc::time_point now_fine = fc::time_point::now();
|
||||
// fc::time_point_sec now = now_fine + fc::microseconds(500000);
|
||||
// if (plugin.database().get_slot_time(1) < now) {
|
||||
//fc::time_point now_fine = fc::time_point::now();
|
||||
//fc::time_point_sec now = now_fine + fc::microseconds(500000);
|
||||
//if (plugin.database().get_slot_time(1) < now) {
|
||||
// return; // Not synced
|
||||
// }
|
||||
//}
|
||||
|
||||
const fc::time_point now_fine = fc::time_point::now();
|
||||
const fc::time_point_sec now = now_fine - fc::milliseconds(3000);
|
||||
|
|
@ -873,16 +871,7 @@ void peerplays_sidechain_plugin_impl::settle_sidechain_transactions(sidechain_ty
|
|||
|
||||
void peerplays_sidechain_plugin_impl::on_applied_block(const signed_block &b) {
|
||||
if (first_block_skipped) {
|
||||
if (son_processing_enabled) {
|
||||
schedule_son_processing();
|
||||
} else {
|
||||
const fc::time_point now_fine = fc::time_point::now();
|
||||
const fc::time_point_sec now = now_fine + fc::microseconds(500000);
|
||||
if (plugin.database().get_slot_time(1) >= now) {
|
||||
son_processing_enabled = true;
|
||||
schedule_son_processing();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
first_block_skipped = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ void sidechain_net_handler::sidechain_event_data_received(const sidechain_event_
|
|||
|
||||
bool enable_peerplays_asset_deposits = false;
|
||||
#ifdef ENABLE_PEERPLAYS_ASSET_DEPOSITS
|
||||
// enable_peerplays_asset_deposits = (sed.sidechain == sidechain_type::peerplays) &&
|
||||
//enable_peerplays_asset_deposits = (sed.sidechain == sidechain_type::peerplays) &&
|
||||
// (sed.sidechain_currency.compare("BTC") != 0) &&
|
||||
// (sed.sidechain_currency.compare("ETH") != 0) &&
|
||||
// (sed.sidechain_currency.compare("HBD") != 0) &&
|
||||
|
|
@ -451,7 +451,7 @@ void sidechain_net_handler::process_deposits() {
|
|||
if (swdo.id == object_id_type(0, 0, 0) || !plugin.can_son_participate(sidechain, chain::operation::tag<chain::son_wallet_deposit_process_operation>::value, swdo.id)) {
|
||||
return;
|
||||
}
|
||||
// Ignore the deposits which are not valid anymore, considered refunds.
|
||||
//Ignore the deposits which are not valid anymore, considered refunds.
|
||||
const auto &sidechain_addresses_idx = database.get_index_type<sidechain_address_index>().indices().get<by_sidechain_and_deposit_address_and_expires>();
|
||||
const auto &addr_itr = sidechain_addresses_idx.find(std::make_tuple(sidechain, swdo.sidechain_from, time_point_sec::maximum()));
|
||||
if (addr_itr == sidechain_addresses_idx.end()) {
|
||||
|
|
@ -680,7 +680,7 @@ void sidechain_net_handler::on_applied_block(const signed_block &b) {
|
|||
const bool is_tracked_asset =
|
||||
((sidechain == sidechain_type::bitcoin) && (transfer_op.amount.asset_id == gpo.parameters.btc_asset())) ||
|
||||
((sidechain == sidechain_type::ethereum) && (transfer_op.amount.asset_id == gpo.parameters.eth_asset())) ||
|
||||
((sidechain == sidechain_type::ethereum) && (transfer_op.amount.asset_id != gpo.parameters.btc_asset()) && (transfer_op.amount.asset_id != gpo.parameters.hbd_asset()) && (transfer_op.amount.asset_id != gpo.parameters.hive_asset()) && (transfer_op.amount.asset_id != asset_id_type())) ||
|
||||
((sidechain == sidechain_type::ethereum) && (transfer_op.amount.asset_id != gpo.parameters.btc_asset()) && (transfer_op.amount.asset_id != gpo.parameters.hbd_asset()) && (transfer_op.amount.asset_id != gpo.parameters.hive_asset())) ||
|
||||
((sidechain == sidechain_type::hive) && (transfer_op.amount.asset_id == gpo.parameters.hbd_asset())) ||
|
||||
((sidechain == sidechain_type::hive) && (transfer_op.amount.asset_id == gpo.parameters.hive_asset()));
|
||||
|
||||
|
|
|
|||
|
|
@ -757,8 +757,8 @@ bool sidechain_net_handler_ethereum::settle_sidechain_transaction(const sidechai
|
|||
if ("0x1" == json_receipt.get<std::string>("result.status")) {
|
||||
count += 1;
|
||||
//! Fixme - compare data somehow?
|
||||
// if( sto.transaction == entry_receipt.second.get<std::string>("data") ) {
|
||||
// }
|
||||
//if( sto.transaction == entry_receipt.second.get<std::string>("data") ) {
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -858,14 +858,14 @@ bool sidechain_net_handler_hive::settle_sidechain_transaction(const sidechain_tr
|
|||
boost::property_tree::ptree tx_json;
|
||||
boost::property_tree::read_json(ss_tx, tx_json);
|
||||
|
||||
// const chain::global_property_object &gpo = database.get_global_properties();
|
||||
//const chain::global_property_object &gpo = database.get_global_properties();
|
||||
|
||||
std::string tx_txid = tx_json.get<std::string>("result.transaction_id");
|
||||
uint32_t tx_block_num = tx_json.get<uint32_t>("result.block_num");
|
||||
const uint32_t last_irreversible_block = std::stoul(rpc_client->get_last_irreversible_block_num());
|
||||
|
||||
// std::string tx_address = addr.get_address();
|
||||
// int64_t tx_amount = -1;
|
||||
//std::string tx_address = addr.get_address();
|
||||
//int64_t tx_amount = -1;
|
||||
|
||||
if (tx_block_num <= last_irreversible_block) {
|
||||
if (sto.object_id.is<son_wallet_withdraw_id_type>()) {
|
||||
|
|
@ -918,15 +918,15 @@ void sidechain_net_handler_hive::hive_listener_loop() {
|
|||
}
|
||||
}
|
||||
|
||||
// std::string reply = rpc_client->get_last_irreversible_block_num();
|
||||
// if (!reply.empty()) {
|
||||
//std::string reply = rpc_client->get_last_irreversible_block_num();
|
||||
//if (!reply.empty()) {
|
||||
// uint64_t last_irreversible_block = std::stoul(reply);
|
||||
// if (last_irreversible_block != last_block_received) {
|
||||
// std::string event_data = std::to_string(last_irreversible_block);
|
||||
// handle_event(event_data);
|
||||
// last_block_received = last_irreversible_block;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
void sidechain_net_handler_hive::handle_event(const std::string &event_data) {
|
||||
|
|
@ -960,7 +960,7 @@ void sidechain_net_handler_hive::handle_event(const std::string &event_data) {
|
|||
const auto &amount_child = op_value.get_child("amount");
|
||||
|
||||
uint64_t amount = amount_child.get<uint64_t>("amount");
|
||||
// uint64_t precision = amount_child.get<uint64_t>("precision");
|
||||
//uint64_t precision = amount_child.get<uint64_t>("precision");
|
||||
std::string nai = amount_child.get<std::string>("nai");
|
||||
std::string sidechain_currency = "";
|
||||
price sidechain_currency_price = {};
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@ namespace graphene { namespace peerplays_sidechain {
|
|||
|
||||
sidechain_net_handler_peerplays::sidechain_net_handler_peerplays(peerplays_sidechain_plugin &_plugin, const boost::program_options::variables_map &options) :
|
||||
sidechain_net_handler(sidechain_type::peerplays, _plugin, options) {
|
||||
// const auto &assets_by_symbol = database.get_index_type<asset_index>().indices().get<by_symbol>();
|
||||
// const auto get_asset_id = [&assets_by_symbol](const string &symbol) {
|
||||
//const auto &assets_by_symbol = database.get_index_type<asset_index>().indices().get<by_symbol>();
|
||||
//const auto get_asset_id = [&assets_by_symbol](const string &symbol) {
|
||||
// auto asset_itr = assets_by_symbol.find(symbol);
|
||||
// FC_ASSERT(asset_itr != assets_by_symbol.end(), "Unable to find asset '${sym}'", ("sym", symbol));
|
||||
// return asset_itr->get_id();
|
||||
// };
|
||||
// tracked_assets.push_back(get_asset_id("PBTC"));
|
||||
// tracked_assets.push_back(get_asset_id("PETH"));
|
||||
// tracked_assets.push_back(get_asset_id("PEOS"));
|
||||
//};
|
||||
//tracked_assets.push_back(get_asset_id("PBTC"));
|
||||
//tracked_assets.push_back(get_asset_id("PETH"));
|
||||
//tracked_assets.push_back(get_asset_id("PEOS"));
|
||||
|
||||
if (options.count("peerplays-private-key")) {
|
||||
const std::vector<std::string> pub_priv_keys = options["peerplays-private-key"].as<std::vector<std::string>>();
|
||||
|
|
@ -284,8 +284,8 @@ bool sidechain_net_handler_peerplays::settle_sidechain_transaction(const sidecha
|
|||
}
|
||||
|
||||
if (sto.object_id.is<son_wallet_deposit_id_type>()) {
|
||||
// auto swdo = database.get<son_wallet_deposit_object>(sto.object_id);
|
||||
// settle_amount = asset(swdo.sidechain_amount, swdo.sidechain_currency);
|
||||
//auto swdo = database.get<son_wallet_deposit_object>(sto.object_id);
|
||||
//settle_amount = asset(swdo.sidechain_amount, swdo.sidechain_currency);
|
||||
}
|
||||
|
||||
if (sto.object_id.is<son_wallet_withdraw_id_type>()) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public:
|
|||
{
|
||||
fixture_.init_nathan();
|
||||
fixture_.generate_blocks(HARDFORK_SON_FOR_ETHEREUM_TIME);
|
||||
fixture_.generate_maintenance_block();
|
||||
fixture_.generate_block();
|
||||
}
|
||||
|
||||
void create_son(const std::string& account_name, const std::string& son_url,
|
||||
|
|
|
|||
Loading…
Reference in a new issue