Documentation ¶
Index ¶
- type MockPeer
- func (p *MockPeer) Close() error
- func (p *MockPeer) ReadNextMessage() ([]byte, error)
- func (p *MockPeer) RemoteAddr() net.Addr
- func (p *MockPeer) RemotePub() *btcec.PublicKey
- func (p *MockPeer) SetReadDeadline(t time.Time) error
- func (p *MockPeer) SetWriteDeadline(t time.Time) error
- func (p *MockPeer) Write(b []byte) (n int, err error)
- type MockSigner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPeer ¶
type MockPeer struct { IncomingMsgs chan []byte OutgoingMsgs chan []byte Quit chan struct{} // contains filtered or unexported fields }
MockPeer emulates a single endpoint of brontide transport.
func NewMockPeer ¶
NewMockPeer returns a fresh MockPeer.
func (*MockPeer) ReadNextMessage ¶
ReadNextMessage returns the raw bytes of the next full message read from the remote peer. The read will fail if either party closes the connection or the read deadline expires.
func (*MockPeer) RemoteAddr ¶
RemoteAddr returns the net address of the remote peer.
func (*MockPeer) SetReadDeadline ¶
SetReadDeadline initializes a timer that will cause any pending reads to fail at time t. If t is zero, the deadline is infinite.
func (*MockPeer) SetWriteDeadline ¶
SetWriteDeadline initializes a timer that will cause any pending writes to fail at time t. If t is zero, the deadline is infinite.
type MockSigner ¶
type MockSigner struct {
// contains filtered or unexported fields
}
MockSigner is an input.Signer that allows one to add arbitrary private keys and sign messages by passing the assigned keychain.KeyLocator.
func (*MockSigner) AddPrivKey ¶
func (s *MockSigner) AddPrivKey(privKey *btcec.PrivateKey) keychain.KeyLocator
AddPrivKey records the passed privKey in the MockSigner's registry of keys it can sign with in the future. A unique key locator is returned, allowing the caller to sign with this key when presented via an input.SignDescriptor.
func (*MockSigner) ComputeInputScript ¶
func (s *MockSigner) ComputeInputScript(tx *wire.MsgTx, signDesc *input.SignDescriptor) (*input.Script, error)
ComputeInputScript is not implemented.
func (*MockSigner) SignOutputRaw ¶
func (s *MockSigner) SignOutputRaw(tx *wire.MsgTx, signDesc *input.SignDescriptor) ([]byte, error)
SignOutputRaw signs an input on the passed transaction using the input index in the sign descriptor. The returned signature is the raw DER-encoded signature without the signhash flag.