From 89bd7f9c3e20858cfa24b67b2f5a48d1ff327299 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Sat, 15 Dec 2018 15:38:14 -0600 Subject: [PATCH] Test should honor existing compression --- unittests/block_tests.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unittests/block_tests.cpp b/unittests/block_tests.cpp index cd6af935ec6..012b06d6061 100644 --- a/unittests/block_tests.cpp +++ b/unittests/block_tests.cpp @@ -58,13 +58,14 @@ std::pair corrupt_trx_in_block(validating_te // Make a copy of the valid block and corrupt the transaction auto copy_b = std::make_shared(b->clone()); - auto signed_tx = copy_b->transactions.back().trx.get().get_signed_transaction(); + const auto& packed_trx = copy_b->transactions.back().trx.get(); + auto signed_tx = packed_trx.get_signed_transaction(); // Corrupt one signature signed_tx.signatures.clear(); signed_tx.sign(main.get_private_key(act_name, "active"), main.control->get_chain_id()); // Replace the valid transaction with the invalid transaction - auto invalid_packed_tx = packed_transaction(signed_tx); + auto invalid_packed_tx = packed_transaction(signed_tx, packed_trx.get_compression()); copy_b->transactions.back().trx = invalid_packed_tx; // Re-calculate the transaction merkle