Fix #549 testnet sync
This commit is contained in:
parent
97eaf4575a
commit
fee7bc99fa
2 changed files with 24 additions and 8 deletions
|
|
@ -30,7 +30,7 @@ build-mainnet:
|
||||||
- build/programs/
|
- build/programs/
|
||||||
- build/tests/
|
- build/tests/
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beatrice" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beatrice" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
|
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beatrice" || $CI_COMMIT_BRANCH == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beatrice" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
|
||||||
tags:
|
tags:
|
||||||
- builder
|
- builder
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ build-testnet:
|
||||||
- build/programs/
|
- build/programs/
|
||||||
- build/tests/
|
- build/tests/
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beatrice" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beatrice" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
|
- if: $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beatrice" || $CI_COMMIT_BRANCH == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beatrice" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop"
|
||||||
when: manual
|
when: manual
|
||||||
tags:
|
tags:
|
||||||
- builder
|
- builder
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,18 @@ void_result update_son_wallet_evaluator::do_evaluate(const son_wallet_update_ope
|
||||||
FC_ASSERT(db().head_block_time() >= HARDFORK_SON_TIME, "Not allowed until SON HARDFORK");
|
FC_ASSERT(db().head_block_time() >= HARDFORK_SON_TIME, "Not allowed until SON HARDFORK");
|
||||||
FC_ASSERT( op.payer == db().get_global_properties().parameters.son_account(), "SON paying account must be set as payer." );
|
FC_ASSERT( op.payer == db().get_global_properties().parameters.son_account(), "SON paying account must be set as payer." );
|
||||||
|
|
||||||
|
const son_wallet_id_type son_wallet_id = [&]{
|
||||||
|
if(db().head_block_time() >= HARDFORK_SON_FOR_ETHEREUM_TIME)
|
||||||
|
{
|
||||||
|
const auto ast = active_sidechain_types(db().head_block_time());
|
||||||
|
const auto id = (op.son_wallet_id.instance.value - std::distance(ast.begin(), ast.find(op.sidechain))) / ast.size();
|
||||||
|
return son_wallet_id_type{ id };
|
||||||
|
}
|
||||||
|
|
||||||
|
return op.son_wallet_id;
|
||||||
|
}();
|
||||||
|
|
||||||
const auto& idx = db().get_index_type<son_wallet_index>().indices().get<by_id>();
|
const auto& idx = db().get_index_type<son_wallet_index>().indices().get<by_id>();
|
||||||
const auto ast = active_sidechain_types(db().head_block_time());
|
|
||||||
const auto id = (op.son_wallet_id.instance.value - std::distance(ast.begin(), ast.find(op.sidechain))) / ast.size();
|
|
||||||
const son_wallet_id_type son_wallet_id{ id };
|
|
||||||
FC_ASSERT( idx.find(son_wallet_id) != idx.end() );
|
FC_ASSERT( idx.find(son_wallet_id) != idx.end() );
|
||||||
//auto itr = idx.find(op.son_wallet_id);
|
//auto itr = idx.find(op.son_wallet_id);
|
||||||
//FC_ASSERT( itr->addresses.find(op.sidechain) == itr->addresses.end() ||
|
//FC_ASSERT( itr->addresses.find(op.sidechain) == itr->addresses.end() ||
|
||||||
|
|
@ -110,10 +118,18 @@ void_result update_son_wallet_evaluator::do_evaluate(const son_wallet_update_ope
|
||||||
|
|
||||||
object_id_type update_son_wallet_evaluator::do_apply(const son_wallet_update_operation& op)
|
object_id_type update_son_wallet_evaluator::do_apply(const son_wallet_update_operation& op)
|
||||||
{ try {
|
{ try {
|
||||||
|
const son_wallet_id_type son_wallet_id = [&]{
|
||||||
|
if(db().head_block_time() >= HARDFORK_SON_FOR_ETHEREUM_TIME)
|
||||||
|
{
|
||||||
|
const auto ast = active_sidechain_types(db().head_block_time());
|
||||||
|
const auto id = (op.son_wallet_id.instance.value - std::distance(ast.begin(), ast.find(op.sidechain))) / ast.size();
|
||||||
|
return son_wallet_id_type{ id };
|
||||||
|
}
|
||||||
|
|
||||||
|
return op.son_wallet_id;
|
||||||
|
}();
|
||||||
|
|
||||||
const auto& idx = db().get_index_type<son_wallet_index>().indices().get<by_id>();
|
const auto& idx = db().get_index_type<son_wallet_index>().indices().get<by_id>();
|
||||||
const auto ast = active_sidechain_types(db().head_block_time());
|
|
||||||
const auto id = (op.son_wallet_id.instance.value - std::distance(ast.begin(), ast.find(op.sidechain))) / ast.size();
|
|
||||||
const son_wallet_id_type son_wallet_id{ id };
|
|
||||||
auto itr = idx.find(son_wallet_id);
|
auto itr = idx.find(son_wallet_id);
|
||||||
if (itr != idx.end())
|
if (itr != idx.end())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue