Documentation ¶
Index ¶
- type ClientMock
- func (mock *ClientMock) KeyPresence(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error)
- func (mock *ClientMock) KeyPresenceCalls() []struct{ ... }
- func (mock *ClientMock) Keygen(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_KeygenClient, error)
- func (mock *ClientMock) KeygenCalls() []struct{ ... }
- func (mock *ClientMock) Recover(ctx context.Context, in *tofnd.RecoverRequest, opts ...grpc.CallOption) (*tofnd.RecoverResponse, error)
- func (mock *ClientMock) RecoverCalls() []struct{ ... }
- func (mock *ClientMock) Sign(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_SignClient, error)
- func (mock *ClientMock) SignCalls() []struct{ ... }
- type MultiSigClientMock
- func (mock *MultiSigClientMock) KeyPresence(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error)
- func (mock *MultiSigClientMock) KeyPresenceCalls() []struct{ ... }
- func (mock *MultiSigClientMock) Keygen(ctx context.Context, in *tofnd.KeygenRequest, opts ...grpc.CallOption) (*tofnd.KeygenResponse, error)
- func (mock *MultiSigClientMock) KeygenCalls() []struct{ ... }
- func (mock *MultiSigClientMock) Sign(ctx context.Context, in *tofnd.SignRequest, opts ...grpc.CallOption) (*tofnd.SignResponse, error)
- func (mock *MultiSigClientMock) SignCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientMock ¶
type ClientMock struct { // KeyPresenceFunc mocks the KeyPresence method. KeyPresenceFunc func(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error) // KeygenFunc mocks the Keygen method. KeygenFunc func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_KeygenClient, error) // RecoverFunc mocks the Recover method. RecoverFunc func(ctx context.Context, in *tofnd.RecoverRequest, opts ...grpc.CallOption) (*tofnd.RecoverResponse, error) // SignFunc mocks the Sign method. SignFunc func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_SignClient, error) // contains filtered or unexported fields }
ClientMock is a mock implementation of rpc.Client.
func TestSomethingThatUsesClient(t *testing.T) { // make and configure a mocked rpc.Client mockedClient := &ClientMock{ KeyPresenceFunc: func(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error) { panic("mock out the KeyPresence method") }, KeygenFunc: func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_KeygenClient, error) { panic("mock out the Keygen method") }, RecoverFunc: func(ctx context.Context, in *tofnd.RecoverRequest, opts ...grpc.CallOption) (*tofnd.RecoverResponse, error) { panic("mock out the Recover method") }, SignFunc: func(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_SignClient, error) { panic("mock out the Sign method") }, } // use mockedClient in code that requires rpc.Client // and then make assertions. }
func (*ClientMock) KeyPresence ¶
func (mock *ClientMock) KeyPresence(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error)
KeyPresence calls KeyPresenceFunc.
func (*ClientMock) KeyPresenceCalls ¶
func (mock *ClientMock) KeyPresenceCalls() []struct { Ctx context.Context In *tofnd.KeyPresenceRequest Opts []grpc.CallOption }
KeyPresenceCalls gets all the calls that were made to KeyPresence. Check the length with:
len(mockedClient.KeyPresenceCalls())
func (*ClientMock) Keygen ¶
func (mock *ClientMock) Keygen(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_KeygenClient, error)
Keygen calls KeygenFunc.
func (*ClientMock) KeygenCalls ¶
func (mock *ClientMock) KeygenCalls() []struct { Ctx context.Context Opts []grpc.CallOption }
KeygenCalls gets all the calls that were made to Keygen. Check the length with:
len(mockedClient.KeygenCalls())
func (*ClientMock) Recover ¶
func (mock *ClientMock) Recover(ctx context.Context, in *tofnd.RecoverRequest, opts ...grpc.CallOption) (*tofnd.RecoverResponse, error)
Recover calls RecoverFunc.
func (*ClientMock) RecoverCalls ¶
func (mock *ClientMock) RecoverCalls() []struct { Ctx context.Context In *tofnd.RecoverRequest Opts []grpc.CallOption }
RecoverCalls gets all the calls that were made to Recover. Check the length with:
len(mockedClient.RecoverCalls())
func (*ClientMock) Sign ¶
func (mock *ClientMock) Sign(ctx context.Context, opts ...grpc.CallOption) (tofnd.GG20_SignClient, error)
Sign calls SignFunc.
func (*ClientMock) SignCalls ¶
func (mock *ClientMock) SignCalls() []struct { Ctx context.Context Opts []grpc.CallOption }
SignCalls gets all the calls that were made to Sign. Check the length with:
len(mockedClient.SignCalls())
type MultiSigClientMock ¶
type MultiSigClientMock struct { // KeyPresenceFunc mocks the KeyPresence method. KeyPresenceFunc func(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error) // KeygenFunc mocks the Keygen method. KeygenFunc func(ctx context.Context, in *tofnd.KeygenRequest, opts ...grpc.CallOption) (*tofnd.KeygenResponse, error) // SignFunc mocks the Sign method. SignFunc func(ctx context.Context, in *tofnd.SignRequest, opts ...grpc.CallOption) (*tofnd.SignResponse, error) // contains filtered or unexported fields }
MultiSigClientMock is a mock implementation of rpc.MultiSigClient.
func TestSomethingThatUsesMultiSigClient(t *testing.T) { // make and configure a mocked rpc.MultiSigClient mockedMultiSigClient := &MultiSigClientMock{ KeyPresenceFunc: func(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error) { panic("mock out the KeyPresence method") }, KeygenFunc: func(ctx context.Context, in *tofnd.KeygenRequest, opts ...grpc.CallOption) (*tofnd.KeygenResponse, error) { panic("mock out the Keygen method") }, SignFunc: func(ctx context.Context, in *tofnd.SignRequest, opts ...grpc.CallOption) (*tofnd.SignResponse, error) { panic("mock out the Sign method") }, } // use mockedMultiSigClient in code that requires rpc.MultiSigClient // and then make assertions. }
func (*MultiSigClientMock) KeyPresence ¶
func (mock *MultiSigClientMock) KeyPresence(ctx context.Context, in *tofnd.KeyPresenceRequest, opts ...grpc.CallOption) (*tofnd.KeyPresenceResponse, error)
KeyPresence calls KeyPresenceFunc.
func (*MultiSigClientMock) KeyPresenceCalls ¶
func (mock *MultiSigClientMock) KeyPresenceCalls() []struct { Ctx context.Context In *tofnd.KeyPresenceRequest Opts []grpc.CallOption }
KeyPresenceCalls gets all the calls that were made to KeyPresence. Check the length with:
len(mockedMultiSigClient.KeyPresenceCalls())
func (*MultiSigClientMock) Keygen ¶
func (mock *MultiSigClientMock) Keygen(ctx context.Context, in *tofnd.KeygenRequest, opts ...grpc.CallOption) (*tofnd.KeygenResponse, error)
Keygen calls KeygenFunc.
func (*MultiSigClientMock) KeygenCalls ¶
func (mock *MultiSigClientMock) KeygenCalls() []struct { Ctx context.Context In *tofnd.KeygenRequest Opts []grpc.CallOption }
KeygenCalls gets all the calls that were made to Keygen. Check the length with:
len(mockedMultiSigClient.KeygenCalls())
func (*MultiSigClientMock) Sign ¶
func (mock *MultiSigClientMock) Sign(ctx context.Context, in *tofnd.SignRequest, opts ...grpc.CallOption) (*tofnd.SignResponse, error)
Sign calls SignFunc.
func (*MultiSigClientMock) SignCalls ¶
func (mock *MultiSigClientMock) SignCalls() []struct { Ctx context.Context In *tofnd.SignRequest Opts []grpc.CallOption }
SignCalls gets all the calls that were made to Sign. Check the length with:
len(mockedMultiSigClient.SignCalls())