add more tests
This commit is contained in:
19
rpcx/mock/depositserver.go
Normal file
19
rpcx/mock/depositserver.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type DepositServer struct {
|
||||
}
|
||||
|
||||
func (*DepositServer) Deposit(ctx context.Context, req *DepositRequest) (*DepositResponse, error) {
|
||||
if req.GetAmount() < 0 {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "cannot deposit %v", req.GetAmount())
|
||||
}
|
||||
|
||||
return &DepositResponse{Ok: true}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user