From 08ca49a65859f1e37e0989255fb69dbcd69df314 Mon Sep 17 00:00:00 2001 From: mfrankovi Date: Wed, 18 Sep 2024 16:29:42 +0200 Subject: [PATCH] fix: dag block bundle --- .../types/dag_block/src/dag_block_bundle_rlp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/types/dag_block/src/dag_block_bundle_rlp.cpp b/libraries/types/dag_block/src/dag_block_bundle_rlp.cpp index 307815d245..b57a196669 100644 --- a/libraries/types/dag_block/src/dag_block_bundle_rlp.cpp +++ b/libraries/types/dag_block/src/dag_block_bundle_rlp.cpp @@ -12,16 +12,16 @@ dev::bytes encodeDAGBlocksBundleRlp(const std::vector& blocks) { return {}; } - std::unordered_map trx_hash_map; // Map to store transaction hash and its index + std::unordered_map trx_hash_map; // Map to store transaction hash and its index std::vector ordered_trx_hashes; - std::vector> indexes; + std::vector> indexes; for (const auto& block : blocks) { - std::vector idx; + std::vector idx; idx.reserve(block.getTrxs().size()); for (const auto& trx : block.getTrxs()) { - if (const auto [_, ok] = trx_hash_map.try_emplace(trx, static_cast(trx_hash_map.size())); ok) { + if (const auto [_, ok] = trx_hash_map.try_emplace(trx, static_cast(trx_hash_map.size())); ok) { ordered_trx_hashes.push_back(trx); // Track the insertion order } idx.push_back(trx_hash_map[trx]); @@ -65,7 +65,7 @@ std::vector decodeDAGBlocksBundleRlp(const dev::RLP& blocks_bundle_rlp std::vector hashes; hashes.reserve(idx_rlp.itemCount()); std::transform(idx_rlp.begin(), idx_rlp.end(), std::back_inserter(hashes), - [&ordered_trx_hashes](const auto& i) { return ordered_trx_hashes[i.template toInt()]; }); + [&ordered_trx_hashes](const auto& i) { return ordered_trx_hashes[i.template toInt()]; }); dags_trx_hashes.push_back(std::move(hashes)); } @@ -98,7 +98,7 @@ std::shared_ptr decodeDAGBlockBundleRlp(uint64_t index, const dev::RLP std::vector hashes; hashes.reserve(idx_rlp.itemCount()); std::transform(idx_rlp.begin(), idx_rlp.end(), std::back_inserter(hashes), - [&ordered_trx_hashes](const auto& i) { return ordered_trx_hashes[i.template toInt()]; }); + [&ordered_trx_hashes](const auto& i) { return ordered_trx_hashes[i.template toInt()]; }); return std::make_shared(blocks_bundle_rlp[2][index], std::move(hashes)); }