You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

package test
import (
type mockSigner struct {
lnd *LndMockServices
func (s *mockSigner) SignOutputRaw(ctx context.Context, tx *wire.MsgTx,
signDescriptors []*input.SignDescriptor) ([][]byte, error) {
s.lnd.SignOutputRawChannel <- SignOutputRawRequest{
Tx: tx,
SignDescriptors: signDescriptors,
rawSigs := [][]byte{{1, 2, 3}}
return rawSigs, nil
func (s *mockSigner) SignMessage(ctx context.Context, msg []byte,
locator keychain.KeyLocator) ([]byte, error) {
return s.lnd.Signature, nil
func (s *mockSigner) VerifyMessage(ctx context.Context, msg, sig []byte,
pubkey [33]byte) (bool, error) {
// Make the mock somewhat functional by asserting that the message and
// signature is what we expect from the mock parameters.
mockAssertion := bytes.Equal(msg, []byte(s.lnd.SignatureMsg)) &&
bytes.Equal(sig, s.lnd.Signature)
return mockAssertion, nil