From 72dc105991eb262e1ac80fc644885d31ce3ba232 Mon Sep 17 00:00:00 2001 From: Kevin Abramczyk Date: Fri, 8 May 2026 22:36:00 -0400 Subject: [PATCH] fixed blockchain.transaction.get verbose parameter declared required instead of optional --- include/bitcoin/server/interfaces/electrum.hpp | 2 +- test/protocols/electrum/electrum_transactions.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/bitcoin/server/interfaces/electrum.hpp b/include/bitcoin/server/interfaces/electrum.hpp index 506d697f..1593ed50 100644 --- a/include/bitcoin/server/interfaces/electrum.hpp +++ b/include/bitcoin/server/interfaces/electrum.hpp @@ -69,7 +69,7 @@ struct electrum_methods method<"blockchain.transaction.broadcast", string_t>{ "raw_tx" }, method<"blockchain.transaction.broadcast_package", value_t, optional>{ "raw_txs", "verbose" }, - method<"blockchain.transaction.get", string_t, boolean_t>{ "tx_hash", "verbose" }, + method<"blockchain.transaction.get", string_t, optional>{ "tx_hash", "verbose" }, method<"blockchain.transaction.get_merkle", string_t, number_t>{ "tx_hash", "height" }, method<"blockchain.transaction.id_from_pos", number_t, number_t, optional>{ "height", "tx_pos", "merkle" }, diff --git a/test/protocols/electrum/electrum_transactions.cpp b/test/protocols/electrum/electrum_transactions.cpp index 413053f0..7f72798e 100644 --- a/test/protocols/electrum/electrum_transactions.cpp +++ b/test/protocols/electrum/electrum_transactions.cpp @@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_transaction_get__nonexistent_tx__not_f BOOST_REQUIRE_EQUAL(response.at("error").as_object().at("code").as_int64(), not_found.value()); } -BOOST_AUTO_TEST_CASE(electrum__blockchain_transaction_get__missing_param__dropped) +BOOST_AUTO_TEST_CASE(electrum__blockchain_transaction_get__missing_verbose__defaults_false) { BOOST_REQUIRE(handshake(electrum::version::v1_0)); @@ -222,7 +222,8 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_transaction_get__missing_param__droppe const auto tx0_hash = encode_hash(coinbase.hash(false)); const auto request = R"({"id":80,"method":"blockchain.transaction.get","params":["%1%"]})" "\n"; const auto response = get((boost::format(request) % tx0_hash).str()); - REQUIRE_NO_THROW_TRUE(response.at("dropped").as_bool()); + REQUIRE_NO_THROW_TRUE(response.at("result").is_string()); + BOOST_REQUIRE_EQUAL(response.at("result").as_string(), encode_base16(coinbase.to_data(true))); } BOOST_AUTO_TEST_CASE(electrum__blockchain_transaction_get__extra_param__dropped)