diff --git a/api/api.go b/api/api.go index b46102a8a..ee3329399 100644 --- a/api/api.go +++ b/api/api.go @@ -156,7 +156,17 @@ func startGrpcServer( rpcService.RegisterEscrowTransactionServiceServer(grpcServer, &handler.EscrowTransactionHandler{ Service: service.NewEscrowTransactionService(queryExecutor), }) - + // Set GRPC handler for multisig information request + rpcService.RegisterMultisigServiceServer(grpcServer, &handler.MultisigHandler{ + MultisigService: service.NewMultisigService( + queryExecutor, + blockServices[(&chaintype.MainChain{}).GetTypeInt()], + query.NewPendingTransactionQuery(), + query.NewPendingSignatureQuery(), + query.NewMultisignatureInfoQuery(), + )}) + // Set GRPC handler for health check + rpcService.RegisterHealthCheckServiceServer(grpcServer, &handler.HealthCheckHandler{}) // run grpc-gateway handler go func() { if err := grpcServer.Serve(serv); err != nil { @@ -231,5 +241,7 @@ func runProxy(apiPort, rpcPort int) error { _ = rpcService.RegisterTransactionServiceHandlerFromEndpoint(ctx, mux, fmt.Sprintf("localhost:%d", rpcPort), opts) _ = rpcService.RegisterAccountLedgerServiceHandlerFromEndpoint(ctx, mux, fmt.Sprintf("localhost:%d", rpcPort), opts) _ = rpcService.RegisterEscrowTransactionServiceHandlerFromEndpoint(ctx, mux, fmt.Sprintf("localhost:%d", rpcPort), opts) + _ = rpcService.RegisterMultisigServiceHandlerFromEndpoint(ctx, mux, fmt.Sprintf("localhost:%d", rpcPort), opts) + _ = rpcService.RegisterHealthCheckServiceHandlerFromEndpoint(ctx, mux, fmt.Sprintf("localhost:%d", rpcPort), opts) return http.ListenAndServe(fmt.Sprintf(":%d", apiPort), mux) } diff --git a/api/client/GetPendingTransactionByAddress/client.go b/api/client/GetPendingTransactionByAddress/client.go new file mode 100644 index 000000000..b960ea7cb --- /dev/null +++ b/api/client/GetPendingTransactionByAddress/client.go @@ -0,0 +1,55 @@ +package main + +import ( + "context" + "fmt" + "log" + + "github.com/sirupsen/logrus" + + "github.com/spf13/viper" + rpc_model "github.com/zoobc/zoobc-core/common/model" + rpc_service "github.com/zoobc/zoobc-core/common/service" + "github.com/zoobc/zoobc-core/common/util" + "google.golang.org/grpc" +) + +func main() { + var apiRPCPort int + if err := util.LoadConfig("../../../resource", "config", "toml"); err != nil { + logrus.Fatal(err) + } else { + apiRPCPort = viper.GetInt("apiRPCPort") + if apiRPCPort == 0 { + apiRPCPort = 8080 + } + } + + conn, err := grpc.Dial(fmt.Sprintf(":%d", apiRPCPort), grpc.WithInsecure()) + if err != nil { + log.Fatalf("did not connect: %s", err) + } + defer conn.Close() + + c := rpc_service.NewMultisigServiceClient(conn) + + response, err := c.GetPendingTransactionByAddress(context.Background(), + &rpc_model.GetPendingTransactionByAddressRequest{ + SenderAddress: "E6u7lDnLgyiPuklLd6rXNQJI3_kGA1Q7e1BEXdJVB1hy", + Status: rpc_model.PendingTransactionStatus_PendingTransactionPending, + Pagination: &rpc_model.Pagination{ + OrderField: "block_height", + OrderBy: rpc_model.OrderBy_DESC, + Page: 2, + Limit: 1, + }, + }, + ) + + if err != nil { + log.Fatalf("error calling remote.GetBlocks: %s", err) + } + + log.Printf("response from remote.GetBlocks(): %v", response) + +} diff --git a/api/client/GetPendingTransactionDetailByTransactionHash/client.go b/api/client/GetPendingTransactionDetailByTransactionHash/client.go new file mode 100644 index 000000000..e5ea7eb64 --- /dev/null +++ b/api/client/GetPendingTransactionDetailByTransactionHash/client.go @@ -0,0 +1,48 @@ +package main + +import ( + "context" + "fmt" + "log" + + "github.com/sirupsen/logrus" + + "github.com/spf13/viper" + rpc_model "github.com/zoobc/zoobc-core/common/model" + rpc_service "github.com/zoobc/zoobc-core/common/service" + "github.com/zoobc/zoobc-core/common/util" + "google.golang.org/grpc" +) + +func main() { + var apiRPCPort int + if err := util.LoadConfig("../../../resource", "config", "toml"); err != nil { + logrus.Fatal(err) + } else { + apiRPCPort = viper.GetInt("apiRPCPort") + if apiRPCPort == 0 { + apiRPCPort = 8080 + } + } + + conn, err := grpc.Dial(fmt.Sprintf(":%d", apiRPCPort), grpc.WithInsecure()) + if err != nil { + log.Fatalf("did not connect: %s", err) + } + defer conn.Close() + + c := rpc_service.NewMultisigServiceClient(conn) + + response, err := c.GetPendingTransactionDetailByTransactionHash(context.Background(), + &rpc_model.GetPendingTransactionDetailByTransactionHashRequest{ + TransactionHashHex: "1c72a355d480ce3c10b1981a7a22e5c2d7accb0c302dbef47a25119bff1b5e17", + }, + ) + + if err != nil { + log.Fatalf("error calling remote.GetPendingTransactionDetailByTransactionHash: %s", err) + } + + log.Printf("response from remote.GetPendingTransactionDetailByTransactionHash(): %v", response) + +} diff --git a/api/client/HealthCheck/client.go b/api/client/HealthCheck/client.go new file mode 100644 index 000000000..d1f28c3f8 --- /dev/null +++ b/api/client/HealthCheck/client.go @@ -0,0 +1,46 @@ +package main + +import ( + "context" + "fmt" + "log" + + "github.com/sirupsen/logrus" + + "github.com/spf13/viper" + rpc_model "github.com/zoobc/zoobc-core/common/model" + rpc_service "github.com/zoobc/zoobc-core/common/service" + "github.com/zoobc/zoobc-core/common/util" + "google.golang.org/grpc" +) + +func main() { + var apiRPCPort int + if err := util.LoadConfig("../../../resource", "config", "toml"); err != nil { + logrus.Fatal(err) + } else { + apiRPCPort = viper.GetInt("apiRPCPort") + if apiRPCPort == 0 { + apiRPCPort = 8080 + } + } + + conn, err := grpc.Dial(fmt.Sprintf(":%d", apiRPCPort), grpc.WithInsecure()) + if err != nil { + log.Fatalf("did not connect: %s", err) + } + defer conn.Close() + + c := rpc_service.NewHealthCheckServiceClient(conn) + + response, err := c.HealthCheck(context.Background(), + &rpc_model.Empty{}, + ) + + if err != nil { + log.Fatalf("error calling remote.HealthCheck: %s", err) + } + + log.Printf("response from remote.HealthCheck(): %v", response) + +} diff --git a/api/handler/healthCheckHandler.go b/api/handler/healthCheckHandler.go new file mode 100644 index 000000000..f02c62b97 --- /dev/null +++ b/api/handler/healthCheckHandler.go @@ -0,0 +1,16 @@ +package handler + +import ( + "context" + + "github.com/zoobc/zoobc-core/common/model" +) + +type HealthCheckHandler struct { +} + +func (hc *HealthCheckHandler) HealthCheck(context.Context, *model.Empty) (*model.HealthCheckResponse, error) { + return &model.HealthCheckResponse{ + Reply: "pong", + }, nil +} diff --git a/api/handler/multisigHandler.go b/api/handler/multisigHandler.go new file mode 100644 index 000000000..4aeee79be --- /dev/null +++ b/api/handler/multisigHandler.go @@ -0,0 +1,40 @@ +package handler + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/zoobc/zoobc-core/api/service" + + "github.com/zoobc/zoobc-core/common/model" +) + +type ( + MultisigHandler struct { + MultisigService service.MultisigServiceInterface + } +) + +func (msh *MultisigHandler) GetPendingTransactionByAddress( + ctx context.Context, + req *model.GetPendingTransactionByAddressRequest, +) (*model.GetPendingTransactionByAddressResponse, error) { + if req.GetSenderAddress() == "" { + return nil, status.Error(codes.InvalidArgument, "SenderAddressNotProvided") + } + if req.GetPagination().GetPage() < 1 { + return nil, status.Error(codes.InvalidArgument, "PageCannotBeLessThanOne") + } + result, err := msh.MultisigService.GetPendingTransactionByAddress(req) + return result, err +} + +func (msh *MultisigHandler) GetPendingTransactionDetailByTransactionHash( + ctx context.Context, + req *model.GetPendingTransactionDetailByTransactionHashRequest, +) (*model.GetPendingTransactionDetailByTransactionHashResponse, error) { + result, err := msh.MultisigService.GetPendingTransactionDetailByTransactionHash(req) + return result, err +} diff --git a/api/service/multisigService.go b/api/service/multisigService.go new file mode 100644 index 000000000..6711c6c13 --- /dev/null +++ b/api/service/multisigService.go @@ -0,0 +1,193 @@ +package service + +import ( + "database/sql" + "encoding/hex" + + "github.com/zoobc/zoobc-core/common/constant" + + "github.com/sirupsen/logrus" + + "github.com/zoobc/zoobc-core/common/model" + "github.com/zoobc/zoobc-core/common/query" + coreService "github.com/zoobc/zoobc-core/core/service" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ( + MultisigServiceInterface interface { + GetPendingTransactionByAddress( + param *model.GetPendingTransactionByAddressRequest, + ) (*model.GetPendingTransactionByAddressResponse, error) + GetPendingTransactionDetailByTransactionHash( + param *model.GetPendingTransactionDetailByTransactionHashRequest, + ) (*model.GetPendingTransactionDetailByTransactionHashResponse, error) + } + + MultisigService struct { + Executor query.ExecutorInterface + BlockService coreService.BlockServiceInterface + PendingTransactionQuery query.PendingTransactionQueryInterface + PendingSignatureQuery query.PendingSignatureQueryInterface + MultisignatureInfoQuery query.MultisignatureInfoQueryInterface + Logger *logrus.Logger + } +) + +func NewMultisigService( + executor query.ExecutorInterface, + blockService coreService.BlockServiceInterface, + pendingTransactionQuery query.PendingTransactionQueryInterface, + pendingSignatureQuery query.PendingSignatureQueryInterface, + multisignatureQuery query.MultisignatureInfoQueryInterface, +) *MultisigService { + return &MultisigService{ + Executor: executor, + BlockService: blockService, + PendingTransactionQuery: pendingTransactionQuery, + PendingSignatureQuery: pendingSignatureQuery, + MultisignatureInfoQuery: multisignatureQuery, + } +} + +func (ms *MultisigService) GetPendingTransactionByAddress( + param *model.GetPendingTransactionByAddressRequest, +) (*model.GetPendingTransactionByAddressResponse, error) { + var ( + totalRecords uint32 + result []*model.PendingTransaction + err error + musigQuery = query.NewPendingTransactionQuery() + caseQuery = query.NewCaseQuery() + selectQuery string + args []interface{} + ) + caseQuery.Select(musigQuery.TableName, musigQuery.Fields...) + caseQuery.Where(caseQuery.Equal("sender_address", param.GetSenderAddress())) + caseQuery.Where(caseQuery.Equal("status", param.GetStatus())) + caseQuery.Where(caseQuery.Equal("latest", true)) + + selectQuery, args = caseQuery.Build() + + countQuery := query.GetTotalRecordOfSelect(selectQuery) + + countRow, _ := ms.Executor.ExecuteSelectRow(countQuery, false, args...) + err = countRow.Scan( + &totalRecords, + ) + if err != nil { + if err == sql.ErrNoRows { + return nil, status.Error(codes.NotFound, "FailToGetTotalItemInPendingTransaction") + } + return nil, status.Error(codes.Internal, err.Error()) + } + if param.GetPagination().GetOrderField() != "" { + caseQuery.OrderBy(param.GetPagination().GetOrderField(), param.GetPagination().GetOrderBy()) + } + caseQuery.Paginate( + param.GetPagination().GetLimit(), + param.GetPagination().GetPage(), + ) + selectQuery, args = caseQuery.Build() + pendingTransactionsRows, err := ms.Executor.ExecuteSelect(selectQuery, false, args...) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + defer pendingTransactionsRows.Close() + result, err = ms.PendingTransactionQuery.BuildModel(result, pendingTransactionsRows) + if err != nil { + return nil, err + } + return &model.GetPendingTransactionByAddressResponse{ + Count: totalRecords, + Page: param.GetPagination().GetPage(), + PendingTransactions: result, + }, err +} + +func (ms *MultisigService) GetPendingTransactionDetailByTransactionHash( + param *model.GetPendingTransactionDetailByTransactionHashRequest, +) (*model.GetPendingTransactionDetailByTransactionHashResponse, error) { + var ( + validStartHeight uint32 + pendingTx = &model.PendingTransaction{} + pendingSigs []*model.PendingSignature + multisigInfo = &model.MultiSignatureInfo{} + err error + pendingTransactionQuery = query.NewPendingTransactionQuery() + pendingSignatureQuery = query.NewPendingSignatureQuery() + multisigInfoQuery = query.NewMultisignatureInfoQuery() + caseQuery = query.NewCaseQuery() + ) + // get current block height + lastBlock, err := ms.BlockService.GetLastBlock() + if err != nil { + ms.Logger.Error(err) + return nil, status.Error(codes.Internal, "server error") + } + if lastBlock.Height > constant.MinRollbackBlocks { + validStartHeight = lastBlock.Height - constant.MinRollbackBlocks + } + // get pending transaction + txHash, err := hex.DecodeString(param.GetTransactionHashHex()) + if err != nil { + ms.Logger.Error(err) + return nil, status.Error(codes.Internal, "server error") + } + caseQuery.Select(pendingTransactionQuery.TableName, pendingTransactionQuery.Fields...) + caseQuery.Where(caseQuery.Equal("transaction_hash", txHash)) + caseQuery.Where(caseQuery.Equal("latest", true)) + selectPendingTxQuery, args := caseQuery.Build() + pendingTxRow, _ := ms.Executor.ExecuteSelectRow(selectPendingTxQuery, false, args...) + err = ms.PendingTransactionQuery.Scan(pendingTx, pendingTxRow) + if err != nil { + if err == sql.ErrNoRows { + return nil, status.Error(codes.NotFound, "tx not found") + } + ms.Logger.Error(err) + return nil, status.Error(codes.Internal, "server error") + } + // get pending signatures + caseQuery = query.NewCaseQuery() + caseQuery.Select(pendingSignatureQuery.TableName, pendingSignatureQuery.Fields...) + caseQuery.Where(caseQuery.Equal("transaction_hash", txHash)) + caseQuery.Where(caseQuery.Equal("latest", true)) + if pendingTx.Status == model.PendingTransactionStatus_PendingTransactionPending { + caseQuery.Where(caseQuery.GreaterEqual("block_height", validStartHeight)) + } + selectPendingSigQuery, args := caseQuery.Build() + pendingSigRows, err := ms.Executor.ExecuteSelect(selectPendingSigQuery, false, args...) + if err != nil { + ms.Logger.Error(err) + return nil, status.Error(codes.Internal, "server error") + } + defer pendingSigRows.Close() + pendingSigs, err = ms.PendingSignatureQuery.BuildModel(pendingSigs, pendingSigRows) + if err != nil { + ms.Logger.Error(err) + return nil, status.Error(codes.Internal, "server error") + } + // get multisig info if exist + caseQuery = query.NewCaseQuery() + caseQuery.Select(multisigInfoQuery.TableName, multisigInfoQuery.Fields...) + caseQuery.Where(caseQuery.Equal("multisig_address", pendingTx.SenderAddress)) + caseQuery.Where(caseQuery.Equal("latest", true)) + if pendingTx.Status == model.PendingTransactionStatus_PendingTransactionPending { + caseQuery.Where(caseQuery.GreaterEqual("block_height", validStartHeight)) + } + selectMultisigInfoQuery, args := caseQuery.Build() + multisigInfoRow, _ := ms.Executor.ExecuteSelectRow(selectMultisigInfoQuery, false, args...) + err = ms.MultisignatureInfoQuery.Scan(multisigInfo, multisigInfoRow) + if err != nil { + if err != sql.ErrNoRows { + ms.Logger.Error(err) + return nil, status.Error(codes.Internal, "server error") + } + } + return &model.GetPendingTransactionDetailByTransactionHashResponse{ + PendingTransaction: pendingTx, + PendingSignatures: pendingSigs, + MultiSignatureInfo: multisigInfo, + }, nil +} diff --git a/api/service/multisigService_test.go b/api/service/multisigService_test.go new file mode 100644 index 000000000..64c0ae7b6 --- /dev/null +++ b/api/service/multisigService_test.go @@ -0,0 +1,591 @@ +package service + +import ( + "database/sql" + "errors" + "reflect" + "regexp" + "testing" + + "github.com/DATA-DOG/go-sqlmock" + + "github.com/sirupsen/logrus" + "github.com/zoobc/zoobc-core/common/model" + "github.com/zoobc/zoobc-core/common/query" + "github.com/zoobc/zoobc-core/core/service" +) + +var ( + // mock GetPendingTransactionByAddress + mockGetPendingTransactionByAddressExecutorCountFailParam = &model.GetPendingTransactionByAddressRequest{ + SenderAddress: "abc", + Status: model.PendingTransactionStatus_PendingTransactionPending, + Pagination: &model.Pagination{ + OrderField: "block_height", + OrderBy: model.OrderBy_DESC, + Page: 1, + Limit: 1, + }, + } + // mock GetPendingTransactionByAddress +) + +type ( + // mock GetPendingTransactionByAddress + mockGetPendingTransactionByAddressExecutorCountFail struct { + query.Executor + } + mockGetPendingTransactionByAddressExecutorGetPendingTxsFail struct { + query.Executor + } + mockGetPendingTransactionByAddressExecutorGetPendingTxsSuccess struct { + query.Executor + } + mockGetPendingTransactionByAddressPendingTxQueryBuildFail struct { + query.PendingTransactionQuery + } + mockGetPendingTransactionByAddressPendingTxQueryBuildSuccess struct { + query.PendingTransactionQuery + } + // mock GetPendingTransactionByAddress +) + +func (*mockGetPendingTransactionByAddressExecutorCountFail) ExecuteSelectRow( + qe string, tx bool, args ...interface{}, +) (*sql.Row, error) { + db, mock, _ := sqlmock.New() + defer db.Close() + mock.ExpectQuery(regexp.QuoteMeta(qe)).WillReturnRows(sqlmock.NewRows([]string{ + "Total"})) + row := db.QueryRow(qe) + return row, nil +} + +func (*mockGetPendingTransactionByAddressExecutorGetPendingTxsFail) ExecuteSelectRow( + qe string, tx bool, args ...interface{}, +) (*sql.Row, error) { + db, mock, _ := sqlmock.New() + defer db.Close() + mock.ExpectQuery(regexp.QuoteMeta(qe)).WillReturnRows(sqlmock.NewRows([]string{ + "Total"}).AddRow(1)) + row := db.QueryRow(qe) + return row, nil +} + +func (*mockGetPendingTransactionByAddressExecutorGetPendingTxsFail) ExecuteSelect( + qe string, tx bool, args ...interface{}, +) (*sql.Rows, error) { + return nil, errors.New("mockedError") +} + +func (*mockGetPendingTransactionByAddressExecutorGetPendingTxsSuccess) ExecuteSelectRow( + qe string, tx bool, args ...interface{}, +) (*sql.Row, error) { + db, mock, _ := sqlmock.New() + defer db.Close() + mock.ExpectQuery(regexp.QuoteMeta(qe)).WillReturnRows(sqlmock.NewRows([]string{ + "Total"}).AddRow(1)) + row := db.QueryRow(qe) + return row, nil +} + +func (*mockGetPendingTransactionByAddressExecutorGetPendingTxsSuccess) ExecuteSelect( + qe string, tx bool, args ...interface{}, +) (*sql.Rows, error) { + db, mock, _ := sqlmock.New() + defer db.Close() + mock.ExpectQuery(regexp.QuoteMeta(qe)).WillReturnRows(sqlmock.NewRows([]string{ + "mockedColumn"}).AddRow(1)) + rows, _ := db.Query(qe) + return rows, nil +} + +func (*mockGetPendingTransactionByAddressPendingTxQueryBuildFail) BuildModel( + pts []*model.PendingTransaction, rows *sql.Rows, +) ([]*model.PendingTransaction, error) { + return nil, errors.New("mockedError") +} + +func (*mockGetPendingTransactionByAddressPendingTxQueryBuildSuccess) BuildModel( + pts []*model.PendingTransaction, rows *sql.Rows, +) ([]*model.PendingTransaction, error) { + return []*model.PendingTransaction{}, nil +} + +func TestMultisigService_GetPendingTransactionByAddress(t *testing.T) { + type fields struct { + Executor query.ExecutorInterface + BlockService service.BlockServiceInterface + PendingTransactionQuery query.PendingTransactionQueryInterface + PendingSignatureQuery query.PendingSignatureQueryInterface + MultisignatureInfoQuery query.MultisignatureInfoQueryInterface + Logger *logrus.Logger + } + type args struct { + param *model.GetPendingTransactionByAddressRequest + } + tests := []struct { + name string + fields fields + args args + want *model.GetPendingTransactionByAddressResponse + wantErr bool + }{ + { + name: "GetPendingTransactionByAddress-fail-countExecuteSelectRow-error-noRow", + fields: fields{ + Executor: &mockGetPendingTransactionByAddressExecutorCountFail{}, + BlockService: nil, + PendingTransactionQuery: nil, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: nil, + }, + args: args{ + param: mockGetPendingTransactionByAddressExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionByAddress-fail-GetPendingTxsExecutor-error", + fields: fields{ + Executor: &mockGetPendingTransactionByAddressExecutorGetPendingTxsFail{}, + BlockService: nil, + PendingTransactionQuery: nil, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: nil, + }, + args: args{ + param: mockGetPendingTransactionByAddressExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionByAddress-fail-PendingTxQueryBuild-error", + fields: fields{ + Executor: &mockGetPendingTransactionByAddressExecutorGetPendingTxsSuccess{}, + BlockService: nil, + PendingTransactionQuery: &mockGetPendingTransactionByAddressPendingTxQueryBuildFail{}, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: nil, + }, + args: args{ + param: mockGetPendingTransactionByAddressExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionByAddress-success", + fields: fields{ + Executor: &mockGetPendingTransactionByAddressExecutorGetPendingTxsSuccess{}, + BlockService: nil, + PendingTransactionQuery: &mockGetPendingTransactionByAddressPendingTxQueryBuildSuccess{}, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: nil, + }, + args: args{ + param: mockGetPendingTransactionByAddressExecutorCountFailParam, + }, + want: &model.GetPendingTransactionByAddressResponse{ + Count: 1, + Page: 1, + PendingTransactions: []*model.PendingTransaction{}, + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ms := &MultisigService{ + Executor: tt.fields.Executor, + BlockService: tt.fields.BlockService, + PendingTransactionQuery: tt.fields.PendingTransactionQuery, + PendingSignatureQuery: tt.fields.PendingSignatureQuery, + MultisignatureInfoQuery: tt.fields.MultisignatureInfoQuery, + Logger: tt.fields.Logger, + } + got, err := ms.GetPendingTransactionByAddress(tt.args.param) + if (err != nil) != tt.wantErr { + t.Errorf("GetPendingTransactionByAddress() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetPendingTransactionByAddress() got = %v, want %v", got, tt.want) + } + }) + } +} + +var ( + // mock GetPendingTransactionByAddress + mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam = &model.GetPendingTransactionDetailByTransactionHashRequest{ + TransactionHashHex: "1c72a355d480ce3c10b1981a7a22e5c2d7accb0c302dbef47a25119bff1b5e17", + } + mockLastBlock = &model.Block{ + Height: 1000, + } + mockPendingTransaction = &model.PendingTransaction{ + SenderAddress: "ABC", + TransactionHash: make([]byte, 32), + TransactionBytes: make([]byte, 100), + Status: model.PendingTransactionStatus_PendingTransactionPending, + BlockHeight: 800, + Latest: true, + } + mockMultisigInfo = &model.MultiSignatureInfo{ + MinimumSignatures: 2, + Nonce: 3, + Addresses: []string{"A", "B", "C"}, + MultisigAddress: "ABC", + BlockHeight: 400, + Latest: true, + } + +// mock GetPendingTransactionByAddress +) + +type ( + mockGetPendingTransactionByTransactionHashBlockServiceFail struct { + service.BlockService + } + + mockGetPendingTransactionByTransactionHashBlockServiceSuccess struct { + service.BlockService + } + + mockGetPendingTransactionByTransactionHashPendingQueryScanNoRow struct { + query.PendingTransactionQuery + } + mockGetPendingTransactionByTransactionHashPendingQueryScanOtherError struct { + query.PendingTransactionQuery + } + mockGetPendingTransactionByTransactionHashPendingQueryScanSuccess struct { + query.PendingTransactionQuery + } + + mockGetPendingTransactionByTransactionHashGetPendingTxExecutorSuccess struct { + query.Executor + } + + mockGetPendingTransactionByTransactionHashGetPendingSigExecutorFail struct { + mockGetPendingTransactionByTransactionHashGetPendingTxExecutorSuccess + } + + mockGetPendingTransactionByTransactionHashGetPendingSigExecutorSuccess struct { + mockGetPendingTransactionByTransactionHashGetPendingTxExecutorSuccess + } + + mockGetPendingTransactionByTransactionHashPendingSigQueryBuildFail struct { + query.PendingSignatureQuery + } + + mockGetPendingTransactionByTransactionHashPendingSigQueryBuildSuccess struct { + query.PendingSignatureQuery + } + + mockGetPendingTransactionByTransactionHashMultisigInfoScanFailOtherError struct { + query.MultisignatureInfoQuery + } + mockGetPendingTransactionByTransactionHashMultisigInfoScanSuccess struct { + query.MultisignatureInfoQuery + } +) + +func (*mockGetPendingTransactionByTransactionHashBlockServiceFail) GetLastBlock() (*model.Block, error) { + return nil, errors.New("mockedError") +} + +func (*mockGetPendingTransactionByTransactionHashBlockServiceSuccess) GetLastBlock() (*model.Block, error) { + return mockLastBlock, nil +} + +func (*mockGetPendingTransactionByTransactionHashPendingQueryScanNoRow) Scan( + pendingTx *model.PendingTransaction, row *sql.Row) error { + return sql.ErrNoRows +} + +func (*mockGetPendingTransactionByTransactionHashPendingQueryScanOtherError) Scan( + pendingTx *model.PendingTransaction, row *sql.Row) error { + return errors.New("mockedError") +} + +func (*mockGetPendingTransactionByTransactionHashPendingQueryScanSuccess) Scan( + pendingTx *model.PendingTransaction, row *sql.Row) error { + *pendingTx = *mockPendingTransaction + return nil +} + +func (*mockGetPendingTransactionByTransactionHashGetPendingTxExecutorSuccess) ExecuteSelectRow( + qe string, tx bool, args ...interface{}) (*sql.Row, error) { + db, mock, _ := sqlmock.New() + defer db.Close() + mock.ExpectQuery(regexp.QuoteMeta(qe)).WillReturnRows(sqlmock.NewRows([]string{ + "mockedColumn"}).AddRow(1)) + row := db.QueryRow(qe) + return row, nil +} + +func (*mockGetPendingTransactionByTransactionHashGetPendingSigExecutorFail) ExecuteSelect( + qe string, tx bool, args ...interface{}) (*sql.Rows, error) { + return nil, errors.New("mockedError") +} + +func (*mockGetPendingTransactionByTransactionHashGetPendingSigExecutorSuccess) ExecuteSelect( + qe string, tx bool, args ...interface{}) (*sql.Rows, error) { + db, mock, _ := sqlmock.New() + defer db.Close() + mock.ExpectQuery(regexp.QuoteMeta(qe)).WillReturnRows(sqlmock.NewRows([]string{ + "mockedColumn"}).AddRow(1)) + rows, _ := db.Query(qe) + return rows, nil +} + +func (*mockGetPendingTransactionByTransactionHashPendingSigQueryBuildFail) BuildModel( + pendingSigs []*model.PendingSignature, rows *sql.Rows, +) ([]*model.PendingSignature, error) { + return nil, errors.New("mockedError") +} + +func (*mockGetPendingTransactionByTransactionHashPendingSigQueryBuildSuccess) BuildModel( + pendingSigs []*model.PendingSignature, rows *sql.Rows, +) ([]*model.PendingSignature, error) { + return []*model.PendingSignature{}, nil +} + +func (*mockGetPendingTransactionByTransactionHashMultisigInfoScanFailOtherError) Scan( + multisigInfo *model.MultiSignatureInfo, row *sql.Row, +) error { + return errors.New("mockedError") +} + +func (*mockGetPendingTransactionByTransactionHashMultisigInfoScanSuccess) Scan(multisigInfo *model.MultiSignatureInfo, row *sql.Row) error { + *multisigInfo = *mockMultisigInfo + return nil +} + +func TestMultisigService_GetPendingTransactionDetailByTransactionHash(t *testing.T) { + type fields struct { + Executor query.ExecutorInterface + BlockService service.BlockServiceInterface + PendingTransactionQuery query.PendingTransactionQueryInterface + PendingSignatureQuery query.PendingSignatureQueryInterface + MultisignatureInfoQuery query.MultisignatureInfoQueryInterface + Logger *logrus.Logger + } + type args struct { + param *model.GetPendingTransactionDetailByTransactionHashRequest + } + tests := []struct { + name string + fields fields + args args + want *model.GetPendingTransactionDetailByTransactionHashResponse + wantErr bool + }{ + { + name: "GetPendingTransactionDetailByTransactionHash-fail-getlastblock-error", + fields: fields{ + Executor: nil, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceFail{}, + PendingTransactionQuery: nil, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: logrus.New(), + }, + args: args{ + param: mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionDetailByTransactionHash-fail-wrongTxHashHex", + fields: fields{ + Executor: nil, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceSuccess{}, + PendingTransactionQuery: nil, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: logrus.New(), + }, + args: args{ + param: &model.GetPendingTransactionDetailByTransactionHashRequest{ + TransactionHashHex: "PPPP", + }, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionDetailByTransactionHash-fail-no-pendingTx", + fields: fields{ + Executor: &mockGetPendingTransactionByTransactionHashGetPendingTxExecutorSuccess{}, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceSuccess{}, + PendingTransactionQuery: &mockGetPendingTransactionByTransactionHashPendingQueryScanNoRow{}, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: logrus.New(), + }, + args: args{ + param: mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + + { + name: "GetPendingTransactionDetailByTransactionHash-fail-scanError", + fields: fields{ + Executor: &mockGetPendingTransactionByTransactionHashGetPendingTxExecutorSuccess{}, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceSuccess{}, + PendingTransactionQuery: &mockGetPendingTransactionByTransactionHashPendingQueryScanOtherError{}, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: logrus.New(), + }, + args: args{ + param: mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionDetailByTransactionHash-fail-executorPendingSigFail", + fields: fields{ + Executor: &mockGetPendingTransactionByTransactionHashGetPendingSigExecutorFail{}, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceSuccess{}, + PendingTransactionQuery: &mockGetPendingTransactionByTransactionHashPendingQueryScanSuccess{}, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: logrus.New(), + }, + args: args{ + param: mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionDetailByTransactionHash-fail-QueryPendingSigFail", + fields: fields{ + Executor: &mockGetPendingTransactionByTransactionHashGetPendingSigExecutorSuccess{}, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceSuccess{}, + PendingTransactionQuery: &mockGetPendingTransactionByTransactionHashPendingQueryScanSuccess{}, + PendingSignatureQuery: &mockGetPendingTransactionByTransactionHashPendingSigQueryBuildFail{}, + MultisignatureInfoQuery: nil, + Logger: logrus.New(), + }, + args: args{ + param: mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + { + name: "GetPendingTransactionDetailByTransactionHash-fail-ScanMultsigiInfoFailOtherError", + fields: fields{ + Executor: &mockGetPendingTransactionByTransactionHashGetPendingSigExecutorSuccess{}, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceSuccess{}, + PendingTransactionQuery: &mockGetPendingTransactionByTransactionHashPendingQueryScanSuccess{}, + PendingSignatureQuery: &mockGetPendingTransactionByTransactionHashPendingSigQueryBuildSuccess{}, + MultisignatureInfoQuery: &mockGetPendingTransactionByTransactionHashMultisigInfoScanFailOtherError{}, + Logger: logrus.New(), + }, + args: args{ + param: mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam, + }, + want: nil, + wantErr: true, + }, + + { + name: "GetPendingTransactionDetailByTransactionHash-Success", + fields: fields{ + Executor: &mockGetPendingTransactionByTransactionHashGetPendingSigExecutorSuccess{}, + BlockService: &mockGetPendingTransactionByTransactionHashBlockServiceSuccess{}, + PendingTransactionQuery: &mockGetPendingTransactionByTransactionHashPendingQueryScanSuccess{}, + PendingSignatureQuery: &mockGetPendingTransactionByTransactionHashPendingSigQueryBuildSuccess{}, + MultisignatureInfoQuery: &mockGetPendingTransactionByTransactionHashMultisigInfoScanSuccess{}, + Logger: logrus.New(), + }, + args: args{ + param: mockGetPendingTransactionDetailByTransactionHashExecutorCountFailParam, + }, + want: &model.GetPendingTransactionDetailByTransactionHashResponse{ + PendingTransaction: mockPendingTransaction, + PendingSignatures: []*model.PendingSignature{}, + MultiSignatureInfo: mockMultisigInfo, + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + ms := &MultisigService{ + Executor: tt.fields.Executor, + BlockService: tt.fields.BlockService, + PendingTransactionQuery: tt.fields.PendingTransactionQuery, + PendingSignatureQuery: tt.fields.PendingSignatureQuery, + MultisignatureInfoQuery: tt.fields.MultisignatureInfoQuery, + Logger: tt.fields.Logger, + } + got, err := ms.GetPendingTransactionDetailByTransactionHash(tt.args.param) + if (err != nil) != tt.wantErr { + t.Errorf("GetPendingTransactionDetailByTransactionHash() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetPendingTransactionDetailByTransactionHash() got = %v, want %v", got, tt.want) + } + }) + } +} + +func TestNewMultisigService(t *testing.T) { + type args struct { + executor query.ExecutorInterface + blockService service.BlockServiceInterface + pendingTransactionQuery query.PendingTransactionQueryInterface + pendingSignatureQuery query.PendingSignatureQueryInterface + multisignatureQuery query.MultisignatureInfoQueryInterface + } + tests := []struct { + name string + args args + want *MultisigService + }{ + { + name: "NewMultisigService-success", + args: args{ + executor: nil, + blockService: nil, + pendingTransactionQuery: nil, + pendingSignatureQuery: nil, + multisignatureQuery: nil, + }, + want: &MultisigService{ + Executor: nil, + BlockService: nil, + PendingTransactionQuery: nil, + PendingSignatureQuery: nil, + MultisignatureInfoQuery: nil, + Logger: nil, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := NewMultisigService( + tt.args.executor, tt.args.blockService, tt.args.pendingTransactionQuery, tt.args.pendingSignatureQuery, + tt.args.multisignatureQuery); !reflect.DeepEqual(got, tt.want) { + t.Errorf("NewMultisigService() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/cmd/transaction/generator.go b/cmd/transaction/generator.go index c6b9ec8b6..9c43bd0ae 100644 --- a/cmd/transaction/generator.go +++ b/cmd/transaction/generator.go @@ -425,7 +425,7 @@ func GeneratedMultiSignatureTransaction( return nil } for k, v := range addressSignatures { - if k == "" { + if v == "" { sigType := util.ConvertUint32ToBytes(2) signatures[k] = sigType } else { @@ -436,6 +436,7 @@ func GeneratedMultiSignatureTransaction( signatures[k] = signature } } + fmt.Printf("signatures: %v\n\n\n", signatures) signatureInfo = &model.SignatureInfo{ TransactionHash: transactionHash, Signatures: signatures, diff --git a/cmd/zoomd b/cmd/zoomd deleted file mode 100755 index 7fecc46bc..000000000 Binary files a/cmd/zoomd and /dev/null differ diff --git a/common/model/healthCheck.pb.go b/common/model/healthCheck.pb.go new file mode 100644 index 000000000..d8fa22f54 --- /dev/null +++ b/common/model/healthCheck.pb.go @@ -0,0 +1,79 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: model/healthCheck.proto + +package model + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// HealthCheckResponse represent the response body of health check request +type HealthCheckResponse struct { + Reply string `protobuf:"bytes,1,opt,name=Reply,proto3" json:"Reply,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } +func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } +func (*HealthCheckResponse) ProtoMessage() {} +func (*HealthCheckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_45c88e150f25dc67, []int{0} +} + +func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_HealthCheckResponse.Unmarshal(m, b) +} +func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) +} +func (m *HealthCheckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_HealthCheckResponse.Merge(m, src) +} +func (m *HealthCheckResponse) XXX_Size() int { + return xxx_messageInfo_HealthCheckResponse.Size(m) +} +func (m *HealthCheckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_HealthCheckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_HealthCheckResponse proto.InternalMessageInfo + +func (m *HealthCheckResponse) GetReply() string { + if m != nil { + return m.Reply + } + return "" +} + +func init() { + proto.RegisterType((*HealthCheckResponse)(nil), "model.HealthCheckResponse") +} + +func init() { proto.RegisterFile("model/healthCheck.proto", fileDescriptor_45c88e150f25dc67) } + +var fileDescriptor_45c88e150f25dc67 = []byte{ + // 127 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0xcd, 0x4f, 0x49, + 0xcd, 0xd1, 0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0x70, 0xce, 0x48, 0x4d, 0xce, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x4b, 0x28, 0x69, 0x73, 0x09, 0x7b, 0x20, 0xe4, 0x82, 0x52, + 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x44, 0xb8, 0x58, 0x83, 0x52, 0x0b, 0x72, 0x2a, 0x25, + 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x20, 0x1c, 0x27, 0xad, 0x28, 0x8d, 0xf4, 0xcc, 0x92, 0x8c, + 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xaa, 0xfc, 0xfc, 0xa4, 0x64, 0x08, 0xa9, 0x9b, 0x9c, + 0x5f, 0x94, 0xaa, 0x9f, 0x9c, 0x9f, 0x9b, 0x9b, 0x9f, 0xa7, 0x0f, 0x36, 0x38, 0x89, 0x0d, 0x6c, + 0x8d, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xb7, 0xe9, 0x32, 0xd1, 0x81, 0x00, 0x00, 0x00, +} diff --git a/common/model/multiSignature.pb.go b/common/model/multiSignature.pb.go index c9e88dec1..727797fae 100644 --- a/common/model/multiSignature.pb.go +++ b/common/model/multiSignature.pb.go @@ -330,6 +330,224 @@ func (m *PendingTransaction) GetLatest() bool { return false } +type GetPendingTransactionByAddressRequest struct { + SenderAddress string `protobuf:"bytes,1,opt,name=SenderAddress,proto3" json:"SenderAddress,omitempty"` + Status PendingTransactionStatus `protobuf:"varint,2,opt,name=Status,proto3,enum=model.PendingTransactionStatus" json:"Status,omitempty"` + Pagination *Pagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPendingTransactionByAddressRequest) Reset() { *m = GetPendingTransactionByAddressRequest{} } +func (m *GetPendingTransactionByAddressRequest) String() string { return proto.CompactTextString(m) } +func (*GetPendingTransactionByAddressRequest) ProtoMessage() {} +func (*GetPendingTransactionByAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_136af44c597c17ae, []int{4} +} + +func (m *GetPendingTransactionByAddressRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPendingTransactionByAddressRequest.Unmarshal(m, b) +} +func (m *GetPendingTransactionByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPendingTransactionByAddressRequest.Marshal(b, m, deterministic) +} +func (m *GetPendingTransactionByAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPendingTransactionByAddressRequest.Merge(m, src) +} +func (m *GetPendingTransactionByAddressRequest) XXX_Size() int { + return xxx_messageInfo_GetPendingTransactionByAddressRequest.Size(m) +} +func (m *GetPendingTransactionByAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetPendingTransactionByAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPendingTransactionByAddressRequest proto.InternalMessageInfo + +func (m *GetPendingTransactionByAddressRequest) GetSenderAddress() string { + if m != nil { + return m.SenderAddress + } + return "" +} + +func (m *GetPendingTransactionByAddressRequest) GetStatus() PendingTransactionStatus { + if m != nil { + return m.Status + } + return PendingTransactionStatus_PendingTransactionPending +} + +func (m *GetPendingTransactionByAddressRequest) GetPagination() *Pagination { + if m != nil { + return m.Pagination + } + return nil +} + +type GetPendingTransactionByAddressResponse struct { + // Number of item in current page + Count uint32 `protobuf:"varint,1,opt,name=Count,proto3" json:"Count,omitempty"` + // Starting page + Page uint32 `protobuf:"varint,2,opt,name=Page,proto3" json:"Page,omitempty"` + // content of the request + PendingTransactions []*PendingTransaction `protobuf:"bytes,3,rep,name=PendingTransactions,proto3" json:"PendingTransactions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPendingTransactionByAddressResponse) Reset() { + *m = GetPendingTransactionByAddressResponse{} +} +func (m *GetPendingTransactionByAddressResponse) String() string { return proto.CompactTextString(m) } +func (*GetPendingTransactionByAddressResponse) ProtoMessage() {} +func (*GetPendingTransactionByAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_136af44c597c17ae, []int{5} +} + +func (m *GetPendingTransactionByAddressResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPendingTransactionByAddressResponse.Unmarshal(m, b) +} +func (m *GetPendingTransactionByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPendingTransactionByAddressResponse.Marshal(b, m, deterministic) +} +func (m *GetPendingTransactionByAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPendingTransactionByAddressResponse.Merge(m, src) +} +func (m *GetPendingTransactionByAddressResponse) XXX_Size() int { + return xxx_messageInfo_GetPendingTransactionByAddressResponse.Size(m) +} +func (m *GetPendingTransactionByAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetPendingTransactionByAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPendingTransactionByAddressResponse proto.InternalMessageInfo + +func (m *GetPendingTransactionByAddressResponse) GetCount() uint32 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *GetPendingTransactionByAddressResponse) GetPage() uint32 { + if m != nil { + return m.Page + } + return 0 +} + +func (m *GetPendingTransactionByAddressResponse) GetPendingTransactions() []*PendingTransaction { + if m != nil { + return m.PendingTransactions + } + return nil +} + +type GetPendingTransactionDetailByTransactionHashRequest struct { + // hex of transaction hash + TransactionHashHex string `protobuf:"bytes,1,opt,name=TransactionHashHex,proto3" json:"TransactionHashHex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPendingTransactionDetailByTransactionHashRequest) Reset() { + *m = GetPendingTransactionDetailByTransactionHashRequest{} +} +func (m *GetPendingTransactionDetailByTransactionHashRequest) String() string { + return proto.CompactTextString(m) +} +func (*GetPendingTransactionDetailByTransactionHashRequest) ProtoMessage() {} +func (*GetPendingTransactionDetailByTransactionHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_136af44c597c17ae, []int{6} +} + +func (m *GetPendingTransactionDetailByTransactionHashRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPendingTransactionDetailByTransactionHashRequest.Unmarshal(m, b) +} +func (m *GetPendingTransactionDetailByTransactionHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPendingTransactionDetailByTransactionHashRequest.Marshal(b, m, deterministic) +} +func (m *GetPendingTransactionDetailByTransactionHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPendingTransactionDetailByTransactionHashRequest.Merge(m, src) +} +func (m *GetPendingTransactionDetailByTransactionHashRequest) XXX_Size() int { + return xxx_messageInfo_GetPendingTransactionDetailByTransactionHashRequest.Size(m) +} +func (m *GetPendingTransactionDetailByTransactionHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetPendingTransactionDetailByTransactionHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPendingTransactionDetailByTransactionHashRequest proto.InternalMessageInfo + +func (m *GetPendingTransactionDetailByTransactionHashRequest) GetTransactionHashHex() string { + if m != nil { + return m.TransactionHashHex + } + return "" +} + +type GetPendingTransactionDetailByTransactionHashResponse struct { + PendingTransaction *PendingTransaction `protobuf:"bytes,1,opt,name=PendingTransaction,proto3" json:"PendingTransaction,omitempty"` + PendingSignatures []*PendingSignature `protobuf:"bytes,2,rep,name=PendingSignatures,proto3" json:"PendingSignatures,omitempty"` + MultiSignatureInfo *MultiSignatureInfo `protobuf:"bytes,3,opt,name=MultiSignatureInfo,proto3" json:"MultiSignatureInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPendingTransactionDetailByTransactionHashResponse) Reset() { + *m = GetPendingTransactionDetailByTransactionHashResponse{} +} +func (m *GetPendingTransactionDetailByTransactionHashResponse) String() string { + return proto.CompactTextString(m) +} +func (*GetPendingTransactionDetailByTransactionHashResponse) ProtoMessage() {} +func (*GetPendingTransactionDetailByTransactionHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_136af44c597c17ae, []int{7} +} + +func (m *GetPendingTransactionDetailByTransactionHashResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPendingTransactionDetailByTransactionHashResponse.Unmarshal(m, b) +} +func (m *GetPendingTransactionDetailByTransactionHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPendingTransactionDetailByTransactionHashResponse.Marshal(b, m, deterministic) +} +func (m *GetPendingTransactionDetailByTransactionHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPendingTransactionDetailByTransactionHashResponse.Merge(m, src) +} +func (m *GetPendingTransactionDetailByTransactionHashResponse) XXX_Size() int { + return xxx_messageInfo_GetPendingTransactionDetailByTransactionHashResponse.Size(m) +} +func (m *GetPendingTransactionDetailByTransactionHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetPendingTransactionDetailByTransactionHashResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPendingTransactionDetailByTransactionHashResponse proto.InternalMessageInfo + +func (m *GetPendingTransactionDetailByTransactionHashResponse) GetPendingTransaction() *PendingTransaction { + if m != nil { + return m.PendingTransaction + } + return nil +} + +func (m *GetPendingTransactionDetailByTransactionHashResponse) GetPendingSignatures() []*PendingSignature { + if m != nil { + return m.PendingSignatures + } + return nil +} + +func (m *GetPendingTransactionDetailByTransactionHashResponse) GetMultiSignatureInfo() *MultiSignatureInfo { + if m != nil { + return m.MultiSignatureInfo + } + return nil +} + func init() { proto.RegisterEnum("model.PendingTransactionStatus", PendingTransactionStatus_name, PendingTransactionStatus_value) proto.RegisterType((*MultiSignatureInfo)(nil), "model.MultiSignatureInfo") @@ -337,41 +555,56 @@ func init() { proto.RegisterMapType((map[string][]byte)(nil), "model.SignatureInfo.SignaturesEntry") proto.RegisterType((*PendingSignature)(nil), "model.PendingSignature") proto.RegisterType((*PendingTransaction)(nil), "model.PendingTransaction") + proto.RegisterType((*GetPendingTransactionByAddressRequest)(nil), "model.GetPendingTransactionByAddressRequest") + proto.RegisterType((*GetPendingTransactionByAddressResponse)(nil), "model.GetPendingTransactionByAddressResponse") + proto.RegisterType((*GetPendingTransactionDetailByTransactionHashRequest)(nil), "model.GetPendingTransactionDetailByTransactionHashRequest") + proto.RegisterType((*GetPendingTransactionDetailByTransactionHashResponse)(nil), "model.GetPendingTransactionDetailByTransactionHashResponse") } func init() { proto.RegisterFile("model/multiSignature.proto", fileDescriptor_136af44c597c17ae) } var fileDescriptor_136af44c597c17ae = []byte{ - // 491 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdf, 0x8a, 0xd3, 0x40, - 0x14, 0xc6, 0x9d, 0x64, 0x53, 0xec, 0xd9,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0x47, 0xc5, 0x95, 0x36, 0xdb, 0xcc, 0xb7, 0x91, 0x62, 0xfb, 0xff, 0x4f, 0xe1, 0xe0, 0x3b, - 0x02, 0xef, 0x4f, 0xe5, 0xf1, 0x03, 0xb8, 0xd7, 0xd4, 0x0a, 0xe2, 0xde, 0xc2, 0x0f, 0xa1, 0xd7, - 0x94, 0x27, 0x37, 0x8c, 0x66, 0x9a, 0x45, 0x2e, 0xc2, 0x3d, 0x38, 0x69, 0xea, 0x57, 0xf2, 0xfd, - 0xd2, 0xb5, 0xf6, 0x97, 0x9e, 0xdc, 0x2c, 0x79, 0xca, 0x22, 0xd7, 0x1e, 0x0f, 0x3e, 0x05, 0x31, - 0xd7, 0xf3, 0x6c, 0x36, 0xa4, 0x32, 0x19, 0x7d, 0x95, 0x72, 0x46, 0xf3, 0xe7, 0x53, 0x2a, 0x53, - 0x36, 0xa2, 0x32, 0x49, 0xa4, 0x18, 0x99, 0x74, 0x66, 0x2d, 0xf3, 0xdf, 0x78, 0xfe, 0x3b, 0x00, - 0x00, 0xff, 0xff, 0x25, 0x40, 0xb8, 0x4b, 0x55, 0x04, 0x00, 0x00, + // 671 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0x65, 0xec, 0x26, 0x22, 0x37, 0x4d, 0xeb, 0x0e, 0xa8, 0xb8, 0x11, 0x0f, 0x2b, 0x2a, 0x95, + 0x55, 0x41, 0x02, 0x29, 0x12, 0x08, 0x89, 0x45, 0x43, 0x23, 0x5a, 0x41, 0x4b, 0x35, 0x65, 0xc5, + 0xce, 0xb5, 0x07, 0xd7, 0x6a, 0x3c, 0x13, 0xec, 0x31, 0x6a, 0xd8, 0xf2, 0x09, 0xb0, 0xe7, 0x3b, + 0x90, 0x10, 0x9f, 0xc2, 0xb7, 0x20, 0xcf, 0x38, 0x2f, 0xdb, 0x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f7, 0xb6, + 0xdf, 0xdb, 0x7e, 0x20, 0xce, 0x92, 0xd3, 0xb6, 0xcb, 0xc3, 0xce, 0x67, 0xce, 0x4f, 0x5d, 0xf5, + 0xfb, 0xd0, 0xe5, 0x11, 0xed, 0xb8, 0x3c, 0x0c, 0x39, 0xeb, 0x48, 0xa5, 0xa7, 0x55, 0xf9, 0x5f, + 0xb8, 0xf3, 0x27, 0x00, 0x00, 0xff, 0xff, 0x63, 0xca, 0x3d, 0x33, 0x48, 0x07, 0x00, 0x00, } diff --git a/common/schema b/common/schema index 6558d9252..da8458b70 160000 --- a/common/schema +++ b/common/schema @@ -1 +1 @@ -Subproject commit 6558d9252a95e48bb3188139ce091f1bc1ce5e22 +Subproject commit da8458b700eada69abfede8c49d2481c3a686ee2 diff --git a/common/service/healthCheck.pb.go b/common/service/healthCheck.pb.go new file mode 100644 index 000000000..de6863440 --- /dev/null +++ b/common/service/healthCheck.pb.go @@ -0,0 +1,116 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: service/healthCheck.proto + +package service + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + model "github.com/zoobc/zoobc-core/common/model" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("service/healthCheck.proto", fileDescriptor_d49ba8c80ab0bb27) } + +var fileDescriptor_d49ba8c80ab0bb27 = []byte{ + // 203 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x4e, 0x2d, 0x2a, + 0xcb, 0x4c, 0x4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0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// HealthCheckServiceClient is the client API for HealthCheckService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type HealthCheckServiceClient interface { + HealthCheck(ctx context.Context, in *model.Empty, opts ...grpc.CallOption) (*model.HealthCheckResponse, error) +} + +type healthCheckServiceClient struct { + cc *grpc.ClientConn +} + +func NewHealthCheckServiceClient(cc *grpc.ClientConn) HealthCheckServiceClient { + return &healthCheckServiceClient{cc} +} + +func (c *healthCheckServiceClient) HealthCheck(ctx context.Context, in *model.Empty, opts ...grpc.CallOption) (*model.HealthCheckResponse, error) { + out := new(model.HealthCheckResponse) + err := c.cc.Invoke(ctx, "/service.HealthCheckService/HealthCheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HealthCheckServiceServer is the server API for HealthCheckService service. +type HealthCheckServiceServer interface { + HealthCheck(context.Context, *model.Empty) (*model.HealthCheckResponse, error) +} + +func RegisterHealthCheckServiceServer(s *grpc.Server, srv HealthCheckServiceServer) { + s.RegisterService(&_HealthCheckService_serviceDesc, srv) +} + +func _HealthCheckService_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(model.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HealthCheckServiceServer).HealthCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service.HealthCheckService/HealthCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HealthCheckServiceServer).HealthCheck(ctx, req.(*model.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _HealthCheckService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "service.HealthCheckService", + HandlerType: (*HealthCheckServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "HealthCheck", + Handler: _HealthCheckService_HealthCheck_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service/healthCheck.proto", +} diff --git a/common/service/healthCheck.pb.gw.go b/common/service/healthCheck.pb.gw.go new file mode 100644 index 000000000..0e2bb2092 --- /dev/null +++ b/common/service/healthCheck.pb.gw.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service/healthCheck.proto + +/* +Package service is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package service + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/zoobc/zoobc-core/common/model" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_HealthCheckService_HealthCheck_0(ctx context.Context, marshaler runtime.Marshaler, client HealthCheckServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq model.Empty + var metadata runtime.ServerMetadata + + msg, err := client.HealthCheck(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterHealthCheckServiceHandlerFromEndpoint is same as RegisterHealthCheckServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterHealthCheckServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterHealthCheckServiceHandler(ctx, mux, conn) +} + +// RegisterHealthCheckServiceHandler registers the http handlers for service HealthCheckService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterHealthCheckServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterHealthCheckServiceHandlerClient(ctx, mux, NewHealthCheckServiceClient(conn)) +} + +// RegisterHealthCheckServiceHandlerClient registers the http handlers for service HealthCheckService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HealthCheckServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HealthCheckServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "HealthCheckServiceClient" to call the correct interceptors. +func RegisterHealthCheckServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HealthCheckServiceClient) error { + + mux.Handle("GET", pattern_HealthCheckService_HealthCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HealthCheckService_HealthCheck_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HealthCheckService_HealthCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_HealthCheckService_HealthCheck_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "health", "check"}, "")) +) + +var ( + forward_HealthCheckService_HealthCheck_0 = runtime.ForwardResponseMessage +) diff --git a/common/service/multiSignature.pb.go b/common/service/multiSignature.pb.go new file mode 100644 index 000000000..8242606b3 --- /dev/null +++ b/common/service/multiSignature.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: service/multiSignature.proto + +package service + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + model "github.com/zoobc/zoobc-core/common/model" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("service/multiSignature.proto", fileDescriptor_c7c370ee2b80617f) } + +var fileDescriptor_c7c370ee2b80617f = []byte{ + // 276 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xbf, 0x4a, 0xc4, 0x40, + 0x10, 0x87, 0x39, 0x05, 0x85, 0x34, 0xc2, 0x96, 0xe1, 0xb0, 0xb0, 0xd4, 0x24, 0x8b, 0x5e, 0xa5, + 0x57, 0x5d, 0x10, 0xb4, 0x11, 0xc4, 0xb3, 0xb2, 0xdb, 0x6c, 0x86, 0xbd, 0x81, 0xec, 0x4e, 0xdc, + 0xd9, 0x1c, 0x9c, 0xa5, 0xaf, 0xe0, 0x9b, 0xe8, 0xa3, 0xf8, 0x0a, 0x56, 0x3e, 0x85, 0x5c, 0x12, + 0xc1, 0xe2, 0xfe, 0xc8, 0x35, 0x5b, 0xec, 0xfc, 0xbe, 0xd9, 0xf9, 0xd8, 0x89, 0x86, 0x0c, 0x7e, + 0x8e, 0x1a, 0xa4, 0x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, 0xff, 0xff, 0xc0, 0xb5, 0x83, 0xe9, + 0x4d, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MultisigServiceClient is the client API for MultisigService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MultisigServiceClient interface { + GetPendingTransactionByAddress(ctx context.Context, in *model.GetPendingTransactionByAddressRequest, opts ...grpc.CallOption) (*model.GetPendingTransactionByAddressResponse, error) + GetPendingTransactionDetailByTransactionHash(ctx context.Context, in *model.GetPendingTransactionDetailByTransactionHashRequest, opts ...grpc.CallOption) (*model.GetPendingTransactionDetailByTransactionHashResponse, error) +} + +type multisigServiceClient struct { + cc *grpc.ClientConn +} + +func NewMultisigServiceClient(cc *grpc.ClientConn) MultisigServiceClient { + return &multisigServiceClient{cc} +} + +func (c *multisigServiceClient) GetPendingTransactionByAddress(ctx context.Context, in *model.GetPendingTransactionByAddressRequest, opts ...grpc.CallOption) (*model.GetPendingTransactionByAddressResponse, error) { + out := new(model.GetPendingTransactionByAddressResponse) + err := c.cc.Invoke(ctx, "/service.MultisigService/GetPendingTransactionByAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *multisigServiceClient) GetPendingTransactionDetailByTransactionHash(ctx context.Context, in *model.GetPendingTransactionDetailByTransactionHashRequest, opts ...grpc.CallOption) (*model.GetPendingTransactionDetailByTransactionHashResponse, error) { + out := new(model.GetPendingTransactionDetailByTransactionHashResponse) + err := c.cc.Invoke(ctx, "/service.MultisigService/GetPendingTransactionDetailByTransactionHash", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MultisigServiceServer is the server API for MultisigService service. +type MultisigServiceServer interface { + GetPendingTransactionByAddress(context.Context, *model.GetPendingTransactionByAddressRequest) (*model.GetPendingTransactionByAddressResponse, error) + GetPendingTransactionDetailByTransactionHash(context.Context, *model.GetPendingTransactionDetailByTransactionHashRequest) (*model.GetPendingTransactionDetailByTransactionHashResponse, error) +} + +func RegisterMultisigServiceServer(s *grpc.Server, srv MultisigServiceServer) { + s.RegisterService(&_MultisigService_serviceDesc, srv) +} + +func _MultisigService_GetPendingTransactionByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(model.GetPendingTransactionByAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MultisigServiceServer).GetPendingTransactionByAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service.MultisigService/GetPendingTransactionByAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MultisigServiceServer).GetPendingTransactionByAddress(ctx, req.(*model.GetPendingTransactionByAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MultisigService_GetPendingTransactionDetailByTransactionHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(model.GetPendingTransactionDetailByTransactionHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MultisigServiceServer).GetPendingTransactionDetailByTransactionHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/service.MultisigService/GetPendingTransactionDetailByTransactionHash", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MultisigServiceServer).GetPendingTransactionDetailByTransactionHash(ctx, req.(*model.GetPendingTransactionDetailByTransactionHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _MultisigService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "service.MultisigService", + HandlerType: (*MultisigServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetPendingTransactionByAddress", + Handler: _MultisigService_GetPendingTransactionByAddress_Handler, + }, + { + MethodName: "GetPendingTransactionDetailByTransactionHash", + Handler: _MultisigService_GetPendingTransactionDetailByTransactionHash_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service/multiSignature.proto", +} diff --git a/common/service/multiSignature.pb.gw.go b/common/service/multiSignature.pb.gw.go new file mode 100644 index 000000000..67ab6777c --- /dev/null +++ b/common/service/multiSignature.pb.gw.go @@ -0,0 +1,157 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service/multiSignature.proto + +/* +Package service is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package service + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/zoobc/zoobc-core/common/model" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +var ( + filter_MultisigService_GetPendingTransactionByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_MultisigService_GetPendingTransactionByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client MultisigServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq model.GetPendingTransactionByAddressRequest + var metadata runtime.ServerMetadata + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_MultisigService_GetPendingTransactionByAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPendingTransactionByAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +var ( + filter_MultisigService_GetPendingTransactionDetailByTransactionHash_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_MultisigService_GetPendingTransactionDetailByTransactionHash_0(ctx context.Context, marshaler runtime.Marshaler, client MultisigServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq model.GetPendingTransactionDetailByTransactionHashRequest + var metadata runtime.ServerMetadata + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_MultisigService_GetPendingTransactionDetailByTransactionHash_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetPendingTransactionDetailByTransactionHash(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterMultisigServiceHandlerFromEndpoint is same as RegisterMultisigServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMultisigServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMultisigServiceHandler(ctx, mux, conn) +} + +// RegisterMultisigServiceHandler registers the http handlers for service MultisigService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMultisigServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMultisigServiceHandlerClient(ctx, mux, NewMultisigServiceClient(conn)) +} + +// RegisterMultisigServiceHandlerClient registers the http handlers for service MultisigService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MultisigServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MultisigServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MultisigServiceClient" to call the correct interceptors. +func RegisterMultisigServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MultisigServiceClient) error { + + mux.Handle("GET", pattern_MultisigService_GetPendingTransactionByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MultisigService_GetPendingTransactionByAddress_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_MultisigService_GetPendingTransactionByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_MultisigService_GetPendingTransactionDetailByTransactionHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MultisigService_GetPendingTransactionDetailByTransactionHash_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_MultisigService_GetPendingTransactionDetailByTransactionHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MultisigService_GetPendingTransactionByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "multisig", "GetPendingTransactionByAddress"}, "")) + + pattern_MultisigService_GetPendingTransactionDetailByTransactionHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "multisig", "GetPendingTransactionDetailByTransactionHash"}, "")) +) + +var ( + forward_MultisigService_GetPendingTransactionByAddress_0 = runtime.ForwardResponseMessage + + forward_MultisigService_GetPendingTransactionDetailByTransactionHash_0 = runtime.ForwardResponseMessage +) diff --git a/go.mod b/go.mod index 3ab31cfe5..a6ebebee7 100644 --- a/go.mod +++ b/go.mod @@ -15,22 +15,23 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.11.3 github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect - github.com/magiconair/properties v1.8.1 // indirect github.com/mattn/go-sqlite3 v1.11.0 github.com/pelletier/go-toml v1.5.0 // indirect github.com/pkg/errors v0.8.1 github.com/prometheus/client_golang v1.1.0 - github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect github.com/prometheus/common v0.7.0 // indirect github.com/prometheus/procfs v0.0.5 // indirect github.com/shirou/gopsutil v2.19.9+incompatible github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v0.0.6 + github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.6.2 github.com/tyler-smith/go-bip39 v1.0.2 github.com/ugorji/go/codec v1.1.7 golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 + golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect google.golang.org/genproto v0.0.0-20200306153348-d950eab6f860 google.golang.org/grpc v1.27.0 + gopkg.in/yaml.v2 v2.2.8 // indirect ) diff --git a/go.sum b/go.sum index b17e65a4f..0b361c69d 100644 --- a/go.sum +++ b/go.sum @@ -14,7 +14,6 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -40,8 +39,6 @@ github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46f github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -84,23 +81,17 @@ github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129 h1:tT8iWCYw4uOem71yYA3htfH+LNopJvcqZQshm56G5L4= github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.1 h1:ocYkMQY5RrXTYgXl7ICpV0IXwlEQGwKIsery4gyXa1U= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -112,8 +103,6 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.11.3 h1:h8+NsYENhxNTuq+dobk3+ODoJtwY4Fu0WQXsxJfL8aM= github.com/grpc-ecosystem/grpc-gateway v1.11.3/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.14.1 h1:YuM9SXYy583fxvSOkzCDyBPCtY+/IMSHEG1dKFMLZsA= -github.com/grpc-ecosystem/grpc-gateway v1.14.1/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -126,7 +115,6 @@ github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -136,6 +124,7 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfM github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -148,8 +137,6 @@ github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzR github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= -github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -172,8 +159,6 @@ github.com/pelletier/go-toml v1.5.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -181,39 +166,29 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.5.0 h1:Ctq0iGpCmr3jeP77kbF2UxgvRwzWWz+4Bh9/vJTyg1A= -github.com/prometheus/client_golang v1.5.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shirou/gopsutil v2.19.9+incompatible h1:IrPVlK4nfwW10DF7pW+7YJKws9NkgNzWozwwWv9FsgY= github.com/shirou/gopsutil v2.19.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil v2.20.2+incompatible h1:ucK79BhBpgqQxPASyS2cu9HX8cfDVljBN1WWFvbNvgY= -github.com/shirou/gopsutil v2.20.2+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -237,6 +212,8 @@ github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9 github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= @@ -289,14 +266,11 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 h1:2mqDk8w/o6UmeUCu5Qiq2y7iMf6anbx+YA8d1JFoFrs= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -309,9 +283,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -322,28 +295,21 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03 h1:4HYDjxeNXAOTv3o1N2tjo8UUSlhQgAD52FVkwxnWgM8= -google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200306153348-d950eab6f860 h1:QmnwU8dKvY8c/vZikd2jhBNwrrGS5qeyK/2Aeeh9Grk= google.golang.org/genproto v0.0.0-20200306153348-d950eab6f860/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -352,12 +318,9 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=