input: pass input.Signature to multisig spend
Modifies SpendMultiSig to accept input.Signature, so that we can ultimately assert the size of multisig witnesses.
This commit is contained in:
6 files changed
+87
-50
No files matched your search
@@ -98,7 +98,7 @@ func newChannelTestCtx(chanSize int64) (*channelTestCtx, error) {
|
||||
}
|
||||
|
||||
sigHashes := txscript.NewTxSigHashes(commitTx)
|
||||
aliceSig, err := txscript.RawTxInWitnessSignature(
|
||||
aliceSigRaw, err := txscript.RawTxInWitnessSignature(
|
||||
commitTx, sigHashes, 0, chanSize,
|
||||
multiSigScript, txscript.SigHashAll, alicePriv,
|
||||
)
|
||||
@@ -106,7 +106,14 @@ func newChannelTestCtx(chanSize int64) (*channelTestCtx, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bobSig, err := txscript.RawTxInWitnessSignature(
|
||||
aliceSig, err := btcec.ParseDERSignature(
|
||||
aliceSigRaw, btcec.S256(),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bobSigRaw, err := txscript.RawTxInWitnessSignature(
|
||||
commitTx, sigHashes, 0, chanSize,
|
||||
multiSigScript, txscript.SigHashAll, bobPriv,
|
||||
)
|
||||
@@ -114,6 +121,13 @@ func newChannelTestCtx(chanSize int64) (*channelTestCtx, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bobSig, err := btcec.ParseDERSignature(
|
||||
bobSigRaw, btcec.S256(),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
commitTx.TxIn[0].Witness = input.SpendMultiSig(
|
||||
multiSigScript, alicePub.SerializeCompressed(), aliceSig,
|
||||
bobPub.SerializeCompressed(), bobSig,
|
||||
|
||||
Reference in new issue
Block a user