github.com/decred/dcrlnd@v0.7.6/internal/psbt/psbt_shim.go (about)

     1  package psbt
     2  
     3  import (
     4  	"errors"
     5  	"io"
     6  
     7  	"github.com/decred/dcrd/txscript/v4"
     8  	"github.com/decred/dcrd/wire"
     9  )
    10  
    11  // This file only provides a shim for upstream (btcsuite/btcutil/psbt)
    12  // functions required to build dcrlnd with psbt support and ease porting
    13  // upstream changes.
    14  //
    15  // PSBT is not actually currently supported in dcrlnd.
    16  
    17  type Packet struct {
    18  	UnsignedTx *wire.MsgTx
    19  	Inputs     []PInput
    20  	Outputs    []POutput
    21  }
    22  
    23  func (p *Packet) Serialize(w io.Writer) error {
    24  	panic("psbt.Packet.Serialize() not implemented")
    25  }
    26  
    27  func New(inputs []*wire.OutPoint,
    28  	outputs []*wire.TxOut, version int32, nLockTime uint32,
    29  	nSequences []uint32) (*Packet, error) {
    30  
    31  	panic("psbt.New not implemented")
    32  }
    33  
    34  func NewFromRawBytes(r io.Reader, b64 bool) (*Packet, error) {
    35  	panic("psbt.NewFromRawBytes not implemented")
    36  }
    37  
    38  func NewFromUnsignedTx(tx *wire.MsgTx) (*Packet, error) {
    39  	panic("psbt.NewFromUnsignedTx not implemented")
    40  }
    41  
    42  type POutput struct{}
    43  
    44  func MaybeFinalize(p *Packet, inIndex int) (bool, error) {
    45  	panic("psbt.MaybeFinalize not implemented")
    46  }
    47  
    48  func MaybeFinalizeAll(p *Packet) error {
    49  	return errors.New("psbt.MaybeFinalizeAll not implemented")
    50  }
    51  
    52  func Extract(p *Packet) (*wire.MsgTx, error) {
    53  	return nil, errors.New("psbt.Extract not implemented")
    54  }
    55  
    56  type PInput struct {
    57  	WitnessUtxo        *wire.TxOut
    58  	NonWitnessUtxo     *wire.MsgTx
    59  	FinalScriptSig     []byte
    60  	FinalScriptWitness []byte
    61  	Bip32Derivation    []*Bip32Derivation
    62  	SighashType        txscript.SigHashType
    63  	PartialSigs        []*PartialSig
    64  	RedeemScript       []byte
    65  	WitnessScript      []byte
    66  }