si.WitnessComponents = append(si.WitnessComponents, sw)
}
+func (si *SigningInstruction) AddWitnessKeysWithOutPath(xpubs []chainkd.XPub, quorum int) {
+
+ keyIDs := make([]keyID, 0, len(xpubs))
+ for _, xpub := range xpubs {
+ keyIDs = append(keyIDs, keyID{XPub: xpub})
+ }
+
+ sw := &SignatureWitness{
+ Quorum: quorum,
+ Keys: keyIDs,
+ }
+ si.WitnessComponents = append(si.WitnessComponents, sw)
+}
+
// AddRawWitnessKeys adds a SignatureWitness with the given quorum and
// list of keys derived by applying the derivation path to each of the
// xpubs.
si.WitnessComponents = append(si.WitnessComponents, sw)
}
+func (si *SigningInstruction) AddRawWitnessKeysWithoutPath(xpubs []chainkd.XPub, quorum int) {
+
+ keyIDs := make([]keyID, 0, len(xpubs))
+ for _, xpub := range xpubs {
+ keyIDs = append(keyIDs, keyID{XPub: xpub})
+ }
+
+ sw := &RawTxSigWitness{
+ Quorum: quorum,
+ Keys: keyIDs,
+ }
+ si.WitnessComponents = append(si.WitnessComponents, sw)
+}
+
// SigningInstruction gives directions for signing inputs in a TxTemplate.
type SigningInstruction struct {
Position uint32 `json:"position"`
// arguments for a VM program via its materialize method. Concrete
// witnessComponent types include SignatureWitness and dataWitness.
type witnessComponent interface {
- materialize(*[][]byte) error
+ Materialize(*[][]byte) error
}
// UnmarshalJSON unmarshal SigningInstruction