"context"
"encoding/json"
+ log "github.com/sirupsen/logrus"
+
"github.com/bytom/crypto/ed25519/chainkd"
"github.com/bytom/crypto/sha3pool"
chainjson "github.com/bytom/encoding/json"
)
type (
+ // SignatureWitness is a sign struct
SignatureWitness struct {
// Quorum is the number of signatures required.
Quorum int `json:"quorum"`
}
)
+// ErrEmptyProgram is a type of error
var ErrEmptyProgram = errors.New("empty signature program")
// Sign populates sw.Sigs with as many signatures of the predicate in
}
sigBytes, err := signFn(ctx, keyID.XPub, path, h, auth)
if err != nil {
- return errors.WithDetailf(err, "computing signature %d", i)
+ log.WithField("err", err).Warningf("computing signature %d", i)
+ return nil
}
sw.Sigs[i] = sigBytes
}
return nil
}
+// MarshalJSON convert struct to json
func (sw SignatureWitness) MarshalJSON() ([]byte, error) {
obj := struct {
Type string `json:"type"`