Skip to content

Commit f0eeee2

Browse files
ryanofskyhodlinator
authored andcommitted
test: Add test for TxidFromString() behavior
1 parent 33af14e commit f0eeee2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/transaction_tests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,4 +1028,12 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
10281028
}
10291029
}
10301030

1031+
BOOST_AUTO_TEST_CASE(test_TxidFromString)
1032+
{
1033+
// TxidFromString currently ignores string_view length and reads the whole
1034+
// string, not the specified substring.
1035+
BOOST_CHECK_EQUAL(TxidFromString(std::string_view("ABCD1234", 4)).ToString(),
1036+
"00000000000000000000000000000000000000000000000000000000abcd1234");
1037+
}
1038+
10311039
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)