1
0
Fork 0
forked from lthn/blockchain

minor improvements here and there

This commit is contained in:
sowle 2024-11-06 14:33:50 +01:00
parent dca18f4963
commit ea394e872a
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 2 additions and 5 deletions

View file

@ -2288,7 +2288,7 @@ namespace currency
gen_context.ao_amount_blinding_mask = crypto::hash_helper_t::hs(CRYPTO_HDS_ASSET_CONTROL_ABM, tx_key.sec);
gen_context.ao_commitment_in_outputs = true;
// set correct asset_id to the corresponding destination entries
// calculate the amount of asset being burnt using asset_id field in inputs and outputs (sources and destinations)
uint64_t amount_of_burned_assets = 0;
for (auto& item : ftp.sources)
{
@ -2343,7 +2343,7 @@ namespace currency
}
if (ado.version < ASSET_DESCRIPTOR_BASE_HF5_VER)
{
CHECK_AND_ASSERT_THROW_MES(ado.opt_descriptor.has_value(), "Internal error: opt_descriptor unset during ASSET_DESCRIPTOR_OPERATION_PUBLIC_BURN for version less then 2");
CHECK_AND_ASSERT_THROW_MES(ado.opt_descriptor.has_value(), "Internal error: opt_descriptor unset during ASSET_DESCRIPTOR_OPERATION_EMIT for version less then 2");
ado.opt_descriptor->current_supply += amount_of_emitted_asset;
}
else

View file

@ -1413,7 +1413,6 @@ bool eth_signed_asset_basics::generate(std::vector<test_event_entry>& events) co
m_accounts.resize(TOTAL_ACCS_COUNT);
account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); miner_acc.set_createtime(ts);
account_base& alice_acc = m_accounts[ALICE_ACC_IDX]; alice_acc.generate(); alice_acc.set_createtime(ts);
miner_acc.generate();
MAKE_GENESIS_BLOCK(events, blk_0, miner_acc, ts);
DO_CALLBACK(events, "configure_core"); // default configure_core callback will initialize core runtime config with m_hardforks
@ -1627,7 +1626,6 @@ bool eth_signed_asset_via_rpc::generate(std::vector<test_event_entry>& events) c
account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); miner_acc.set_createtime(ts);
account_base& alice_acc = m_accounts[ALICE_ACC_IDX]; alice_acc.generate(); alice_acc.set_createtime(ts);
account_base& bob_acc = m_accounts[BOB_ACC_IDX]; bob_acc.generate(); bob_acc.set_createtime(ts);
miner_acc.generate();
MAKE_GENESIS_BLOCK(events, blk_0, miner_acc, ts);
DO_CALLBACK(events, "configure_core"); // default configure_core callback will initialize core runtime config with m_hardforks
@ -2420,7 +2418,6 @@ bool several_asset_emit_burn_txs_in_pool::generate(std::vector<test_event_entry>
m_accounts.resize(TOTAL_ACCS_COUNT);
account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); miner_acc.set_createtime(ts);
account_base& alice_acc = m_accounts[ALICE_ACC_IDX]; alice_acc.generate(); alice_acc.set_createtime(ts);
miner_acc.generate();
MAKE_GENESIS_BLOCK(events, blk_0, miner_acc, ts);
// rebuild genesis miner tx