Open ChristianOConnor opened 1 year ago
Your addresses are p2wpkh, but you had coin which were p2wsh
var coins = inputs
.Select(i =>
new Coin(i.PrevOut, inputs.Transaction.Outputs.CreateNewTxOut(Money.Coins(0.1m),
- scriptPubKey.WitHash.ScriptPubKey)))
+ scriptPubKey)))
I am writing tests for an app I built that uses NBitcoin to send bitcoin and make bitcoin transactions.
I have the following code to create fake bitcoins for an integration test:
My integration test has this piece of code that's supposed to send the fake bitcoins to another wallet.
In this code, the
BitcoinHelper.GetBitcoinAddress
function simply receives an address string and returns a proper NBitcoin BitcoinAddress object.This is a picture of the error I get:
Notice the
WitnessProgramMissmatch
error.The issue stems from me not being able to see where the actual error is coming from. I don't know which part of the transaction I get wrong. I don't know if it's the fees, Input, network settings, etc...
What is the problem? Is CreateFakeCoins not correctly creating fake coins for testing? How can I make this work?