Changeset View
Changeset View
Standalone View
Standalone View
src/test/fuzz/psbt.cpp
// Copyright (c) 2019 The Bitcoin Core developers | // Copyright (c) 2019 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <test/fuzz/fuzz.h> | #include <test/fuzz/fuzz.h> | ||||
#include <node/psbt.h> | #include <node/psbt.h> | ||||
#include <optional.h> | |||||
#include <psbt.h> | #include <psbt.h> | ||||
#include <pubkey.h> | #include <pubkey.h> | ||||
#include <script/script.h> | #include <script/script.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <version.h> | #include <version.h> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <memory> | #include <memory> | ||||
Show All 17 Lines | void test_one_input(const std::vector<uint8_t> &buffer) { | ||||
(void)PSBTRoleName(analysis.next); | (void)PSBTRoleName(analysis.next); | ||||
for (const PSBTInputAnalysis &input_analysis : analysis.inputs) { | for (const PSBTInputAnalysis &input_analysis : analysis.inputs) { | ||||
(void)PSBTRoleName(input_analysis.next); | (void)PSBTRoleName(input_analysis.next); | ||||
} | } | ||||
(void)psbt.IsNull(); | (void)psbt.IsNull(); | ||||
(void)psbt.IsSane(); | (void)psbt.IsSane(); | ||||
Optional<CMutableTransaction> tx = psbt.tx; | std::optional<CMutableTransaction> tx = psbt.tx; | ||||
if (tx) { | if (tx) { | ||||
const CMutableTransaction &mtx = *tx; | const CMutableTransaction &mtx = *tx; | ||||
const PartiallySignedTransaction psbt_from_tx{mtx}; | const PartiallySignedTransaction psbt_from_tx{mtx}; | ||||
} | } | ||||
for (const PSBTInput &input : psbt.inputs) { | for (const PSBTInput &input : psbt.inputs) { | ||||
(void)PSBTInputSigned(input); | (void)PSBTInputSigned(input); | ||||
(void)input.IsNull(); | (void)input.IsNull(); | ||||
Show All 27 Lines |