mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Use ParamsWrapper for witness serialization
This commit is contained in:
parent
5800c558eb
commit
6e9e4e6130
59 changed files with 226 additions and 219 deletions
|
|
@ -249,13 +249,13 @@ std::string ConsumeScalarRPCArgument(FuzzedDataProvider& fuzzed_data_provider, b
|
|||
},
|
||||
[&] {
|
||||
// hex encoded block
|
||||
std::optional<CBlock> opt_block = ConsumeDeserializable<CBlock>(fuzzed_data_provider);
|
||||
std::optional<CBlock> opt_block = ConsumeDeserializable<CBlock>(fuzzed_data_provider, TX_WITH_WITNESS);
|
||||
if (!opt_block) {
|
||||
good_data = false;
|
||||
return;
|
||||
}
|
||||
CDataStream data_stream{SER_NETWORK, PROTOCOL_VERSION};
|
||||
data_stream << *opt_block;
|
||||
data_stream << TX_WITH_WITNESS(*opt_block);
|
||||
r = HexStr(data_stream);
|
||||
},
|
||||
[&] {
|
||||
|
|
@ -271,13 +271,14 @@ std::string ConsumeScalarRPCArgument(FuzzedDataProvider& fuzzed_data_provider, b
|
|||
},
|
||||
[&] {
|
||||
// hex encoded tx
|
||||
std::optional<CMutableTransaction> opt_tx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider);
|
||||
std::optional<CMutableTransaction> opt_tx = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider, TX_WITH_WITNESS);
|
||||
if (!opt_tx) {
|
||||
good_data = false;
|
||||
return;
|
||||
}
|
||||
CDataStream data_stream{SER_NETWORK, fuzzed_data_provider.ConsumeBool() ? PROTOCOL_VERSION : (PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS)};
|
||||
data_stream << *opt_tx;
|
||||
DataStream data_stream;
|
||||
auto allow_witness = (fuzzed_data_provider.ConsumeBool() ? TX_WITH_WITNESS : TX_NO_WITNESS);
|
||||
data_stream << allow_witness(*opt_tx);
|
||||
r = HexStr(data_stream);
|
||||
},
|
||||
[&] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue