Skip to content

Commit

Permalink
feat: add new RPC method for block (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackhorseya authored Oct 5, 2024
2 parents b196d83 + b50bf02 commit 879dd11
Show file tree
Hide file tree
Showing 10 changed files with 484 additions and 65 deletions.
5 changes: 5 additions & 0 deletions app/domain/block/block_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,8 @@ func (i *impl) ListBlocks(req *biz.ListBlocksRequest, stream grpc.ServerStreamin

return nil
}

func (i *impl) FoundNewBlockNonStream(c context.Context, req *biz.FoundNewBlockRequest) (*model.Block, error) {
// TODO: 2024/10/5|sean|implement me
panic("implement me")
}
8 changes: 8 additions & 0 deletions app/domain/transaction/transaction_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,11 @@ func (i *txService) ListTransactionsByAccount(

return nil
}

func (i *txService) ProcessBlockTransactionsNonStream(
block *model.Block,
stream grpc.ServerStreamingServer[txM.Transaction],
) error {
// TODO: 2024/10/5|sean|implement me
panic("implement me")
}
57 changes: 32 additions & 25 deletions entity/domain/block/biz/block.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions entity/domain/block/biz/block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ message ListBlocksRequest {
service BlockService {
rpc ScanBlock(ScanBlockRequest) returns (stream Block) {}
rpc FoundNewBlock(stream Block) returns (stream Block) {}
rpc FoundNewBlockNonStream(FoundNewBlockRequest) returns (Block) {}

rpc GetBlock(GetBlockRequest) returns (Block) {}
rpc ListBlocks(ListBlocksRequest) returns (stream Block) {}
Expand Down
46 changes: 42 additions & 4 deletions entity/domain/block/biz/block_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions entity/domain/block/biz/block_grpc_mock.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 879dd11

Please sign in to comment.