Skip to content

Commit 2f273bd

Browse files
authored
Merge pull request #668 from evoskuil/master
Fix dangling reference in electrum test case.
2 parents e80fdbb + f2ffe4c commit 2f273bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/protocols/electrum/electrum_transactions.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_transaction_id_from_pos__merkle_proof_
182182
const auto& coinbase = *block9.transactions_ptr()->front();
183183
const auto tx0_hash = encode_hash(coinbase.hash(false));
184184
const auto request = R"({"id":92,"method":"blockchain.transaction.id_from_pos","params":[9,0,true]})" "\n";
185-
const auto& object = get(request).at("result").as_object();
185+
const auto response = get(request);
186+
BOOST_CHECK(response.at("result").is_object());
187+
188+
const auto& object = response.at("result").as_object();
186189
BOOST_CHECK_EQUAL(object.at("tx_hash").as_string(), tx0_hash);
187190
BOOST_CHECK(object.at("merkle").as_array().empty());
188191
}

0 commit comments

Comments
 (0)