test: wallet, fix change position out of range error

Since #25273, the behavior of 'inserting change at a random
position' is instructed by passing std::nullopt instead of -1.

Also, added missing documentation about the meaning of
'change_pos=std::nullopt' inside 'CWallet::CreateTransaction()'
This commit is contained in:
furszy
2023-12-12 15:03:23 -03:00
parent a7484be65f
commit 37c75c5820
6 changed files with 8 additions and 8 deletions

View File

@@ -129,7 +129,7 @@ static void WalletCreateTx(benchmark::Bench& bench, const OutputType output_type
bench.epochIterations(5).run([&] {
LOCK(wallet.cs_wallet);
const auto& tx_res = CreateTransaction(wallet, recipients, -1, coin_control);
const auto& tx_res = CreateTransaction(wallet, recipients, /*change_pos=*/std::nullopt, coin_control);
assert(tx_res);
});
}