Skip to content

Commit 1e864a7

Browse files
committed
Add wrong_version code.
1 parent 027835a commit 1e864a7

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

include/bitcoin/server/error.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ enum error_t : uint8_t
6464
unconfirmable_transaction,
6565
argument_overflow,
6666
target_overflow,
67+
wrong_version,
6768
server_error
6869
};
6970

src/error.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ DEFINE_ERROR_T_MESSAGE_MAP(error)
5454
{ unconfirmable_transaction, "unconfirmable_transaction" },
5555
{ argument_overflow, "argument_overflow" },
5656
{ target_overflow, "target_overflow" },
57+
{ wrong_version, "wrong_version" },
5758
{ server_error, "server_error" }
5859
};
5960

test/error.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,15 @@ BOOST_AUTO_TEST_CASE(error_t__code__target_overflow__true_expected_message)
236236
BOOST_REQUIRE_EQUAL(ec.message(), "target_overflow");
237237
}
238238

239+
BOOST_AUTO_TEST_CASE(error_t__code__wrong_version__true_expected_message)
240+
{
241+
constexpr auto value = error::wrong_version;
242+
const auto ec = code(value);
243+
BOOST_REQUIRE(ec);
244+
BOOST_REQUIRE(ec == value);
245+
BOOST_REQUIRE_EQUAL(ec.message(), "wrong_version");
246+
}
247+
239248
BOOST_AUTO_TEST_CASE(error_t__code__server_error__true_expected_message)
240249
{
241250
constexpr auto value = error::server_error;

0 commit comments

Comments
 (0)