Skip to content

Commit

Permalink
unit: manager mocks for static address loop-in
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed Nov 5, 2024
1 parent 8d38b42 commit 5f345c4
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
44 changes: 44 additions & 0 deletions staticaddr/address/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,50 @@ type mockStaticAddressClient struct {
mock.Mock
}

func (m *mockStaticAddressClient) ServerStaticAddressLoopIn(ctx context.Context,
in *swapserverrpc.ServerStaticAddressLoopInRequest,
opts ...grpc.CallOption) (
*swapserverrpc.ServerStaticAddressLoopInResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.ServerStaticAddressLoopInResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) PushStaticAddressSweeplessSigs(ctx context.Context,
in *swapserverrpc.PushStaticAddressSweeplessSigsRequest,
opts ...grpc.CallOption) (
*swapserverrpc.PushStaticAddressSweeplessSigsResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.PushStaticAddressSweeplessSigsResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) FetchSweeplessSweepTx(ctx context.Context,
in *swapserverrpc.FetchSweeplessSweepTxRequest,
opts ...grpc.CallOption) (
*swapserverrpc.FetchSweeplessSweepTxResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.FetchSweeplessSweepTxResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) PushStaticAddressHtlcSigs(ctx context.Context,
in *swapserverrpc.PushStaticAddressHtlcSigsRequest,
opts ...grpc.CallOption) (
*swapserverrpc.PushStaticAddressHtlcSigsResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.PushStaticAddressHtlcSigsResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) ServerWithdrawDeposits(ctx context.Context,
in *swapserverrpc.ServerWithdrawRequest,
opts ...grpc.CallOption) (*swapserverrpc.ServerWithdrawResponse,
Expand Down
44 changes: 44 additions & 0 deletions staticaddr/deposit/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,50 @@ type mockStaticAddressClient struct {
mock.Mock
}

func (m *mockStaticAddressClient) ServerStaticAddressLoopIn(ctx context.Context,
in *swapserverrpc.ServerStaticAddressLoopInRequest,
opts ...grpc.CallOption) (
*swapserverrpc.ServerStaticAddressLoopInResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.ServerStaticAddressLoopInResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) PushStaticAddressSweeplessSigs(ctx context.Context,
in *swapserverrpc.PushStaticAddressSweeplessSigsRequest,
opts ...grpc.CallOption) (
*swapserverrpc.PushStaticAddressSweeplessSigsResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.PushStaticAddressSweeplessSigsResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) FetchSweeplessSweepTx(ctx context.Context,
in *swapserverrpc.FetchSweeplessSweepTxRequest,
opts ...grpc.CallOption) (
*swapserverrpc.FetchSweeplessSweepTxResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.FetchSweeplessSweepTxResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) PushStaticAddressHtlcSigs(ctx context.Context,
in *swapserverrpc.PushStaticAddressHtlcSigsRequest,
opts ...grpc.CallOption) (
*swapserverrpc.PushStaticAddressHtlcSigsResponse, error) {

args := m.Called(ctx, in, opts)

return args.Get(0).(*swapserverrpc.PushStaticAddressHtlcSigsResponse),
args.Error(1)
}

func (m *mockStaticAddressClient) ServerWithdrawDeposits(ctx context.Context,
in *swapserverrpc.ServerWithdrawRequest,
opts ...grpc.CallOption) (*swapserverrpc.ServerWithdrawResponse,
Expand Down

0 comments on commit 5f345c4

Please sign in to comment.