aboutsummaryrefslogtreecommitdiff
path: root/tests/core_tests
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-06-10 12:00:54 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-06-10 12:00:54 -0500
commit7499837a6fe8d3533e1360dce8f3ba230ff76042 (patch)
treecd3e089e2e09de33044220ff72461a761b028e3f /tests/core_tests
parentMerge pull request #7729 (diff)
parentImprove cryptonote (block and tx) binary read performance (diff)
downloadmonero-7499837a6fe8d3533e1360dce8f3ba230ff76042.tar.xz
Merge pull request #7661
08e4497 Improve cryptonote (block and tx) binary read performance (Lee Clagett)
Diffstat (limited to 'tests/core_tests')
-rw-r--r--tests/core_tests/chaingen.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h
index dbb8bd3be..3f9f01a11 100644
--- a/tests/core_tests/chaingen.h
+++ b/tests/core_tests/chaingen.h
@@ -648,11 +648,9 @@ public:
bvc.m_verifivation_failed = true;
cryptonote::block blk;
- std::stringstream ss;
- ss << sr_block.data;
- binary_archive<false> ba(ss);
+ binary_archive<false> ba{epee::strspan<std::uint8_t>(sr_block.data)};
::serialization::serialize(ba, blk);
- if (!ss.good())
+ if (!ba.good())
{
blk = cryptonote::block();
}
@@ -671,11 +669,9 @@ public:
bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count();
cryptonote::transaction tx;
- std::stringstream ss;
- ss << sr_tx.data;
- binary_archive<false> ba(ss);
+ binary_archive<false> ba{epee::strspan<std::uint8_t>(sr_tx.data)};
::serialization::serialize(ba, tx);
- if (!ss.good())
+ if (!ba.good())
{
tx = cryptonote::transaction();
}