mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-03-14 12:24:58 +00:00
wire: Make NewMsgTx accept the tx version.
This modifies the NewMsgTx function to accept the transaction version as a parameter and updates all callers. The reason for this change is so the transaction version can be bumped in wire without breaking existing tests and to provide the caller with the flexibility to create the specific transaction version they desire.
This commit is contained in:
@@ -101,7 +101,7 @@ func ExampleSignTxOutput() {
|
||||
// For this example, create a fake transaction that represents what
|
||||
// would ordinarily be the real transaction that is being spent. It
|
||||
// contains a single output that pays to address in the amount of 1 BTC.
|
||||
originTx := wire.NewMsgTx()
|
||||
originTx := wire.NewMsgTx(wire.TxVersion)
|
||||
prevOut := wire.NewOutPoint(&chainhash.Hash{}, ^uint32(0))
|
||||
txIn := wire.NewTxIn(prevOut, []byte{txscript.OP_0, txscript.OP_0})
|
||||
originTx.AddTxIn(txIn)
|
||||
@@ -115,7 +115,7 @@ func ExampleSignTxOutput() {
|
||||
originTxHash := originTx.TxHash()
|
||||
|
||||
// Create the transaction to redeem the fake transaction.
|
||||
redeemTx := wire.NewMsgTx()
|
||||
redeemTx := wire.NewMsgTx(wire.TxVersion)
|
||||
|
||||
// Add the input(s) the redeeming transaction will spend. There is no
|
||||
// signature script at this point since it hasn't been created or signed
|
||||
|
||||
Reference in New Issue
Block a user