| 70 | } |
| 71 | |
| 72 | static CMutableTransaction TestSimpleSpend(const CTransaction& from, uint32_t index, const CKey& key, const CScript& pubkey) |
| 73 | { |
| 74 | CMutableTransaction mtx; |
| 75 | CTxOut txOutNew = CTxOut(); |
| 76 | txOutNew.nValue = from.vout[index].nValue.GetAmount() - DEFAULT_TRANSACTION_MAXFEE; |
| 77 | txOutNew.nAsset = from.vout[index].nAsset; |
| 78 | txOutNew.scriptPubKey = pubkey; |
| 79 | mtx.vout.push_back(txOutNew); |
| 80 | mtx.vin.push_back({CTxIn{from.GetHash(), index}}); |
| 81 | FillableSigningProvider keystore; |
| 82 | keystore.AddKey(key); |
| 83 | std::map<COutPoint, Coin> coins; |
| 84 | coins[mtx.vin[0].prevout].out = from.vout[index]; |
| 85 | std::map<int, bilingual_str> input_errors; |
| 86 | BOOST_CHECK(SignTransaction(mtx, &keystore, coins, SIGHASH_ALL, Params().HashGenesisBlock(), input_errors)); |
| 87 | return mtx; |
| 88 | } |
| 89 | |
| 90 | static void AddKey(CWallet& wallet, const CKey& key) |
| 91 | { |
no test coverage detected