Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/psbt_wallet_tests.cpp
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | CDataStream ssData( | ||||
"cbaa5c8757924f545887bb2abdd750000000000ffffffff6b04ec37326fba" | "cbaa5c8757924f545887bb2abdd750000000000ffffffff6b04ec37326fba" | ||||
"c8e468a73bf952c8877f84f96c3f9deadeab246455e34fe0cd0100000000f" | "c8e468a73bf952c8877f84f96c3f9deadeab246455e34fe0cd0100000000f" | ||||
"fffffff0270aaf008000000001976a914d85c2b71d0060b09c9886aeb815e" | "fffffff0270aaf008000000001976a914d85c2b71d0060b09c9886aeb815e" | ||||
"50991dda124d88ac00e1f505000000001976a91400aea9a2e5f0f876a588d" | "50991dda124d88ac00e1f505000000001976a91400aea9a2e5f0f876a588d" | ||||
"f5546e8742d1d87008f88ac000000000000000000"), | "f5546e8742d1d87008f88ac000000000000000000"), | ||||
SER_NETWORK, PROTOCOL_VERSION); | SER_NETWORK, PROTOCOL_VERSION); | ||||
ssData >> psbtx; | ssData >> psbtx; | ||||
// Use CTransaction for the constant parts of the | |||||
// transaction to avoid rehashing. | |||||
const CTransaction txConst(*psbtx.tx); | |||||
// FIXME: input 2 hd path is missing. | // FIXME: input 2 hd path is missing. | ||||
// The path missing comes from the HD masterkey. | // The path missing comes from the HD masterkey. | ||||
// Fill transaction with our data | // Fill transaction with our data | ||||
FillPSBT(&m_wallet, psbtx, &txConst, SigHashType(), false, true); | FillPSBT(&m_wallet, psbtx, SigHashType(), false, true); | ||||
// Get the final tx | // Get the final tx | ||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); | CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); | ||||
ssTx << psbtx; | ssTx << psbtx; | ||||
std::string final_hex = HexStr(ssTx.begin(), ssTx.end()); | std::string final_hex = HexStr(ssTx.begin(), ssTx.end()); | ||||
BOOST_CHECK_EQUAL( | BOOST_CHECK_EQUAL( | ||||
final_hex, | final_hex, | ||||
"70736274ff0100a0020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c875" | "70736274ff0100a0020000000258e87a21b56daf0c23be8e7070456c336f7cbaa5c875" | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |