cosmosquad-labs / squad

Apache License 2.0
6 stars 3 forks source link

feat: add last blocktime endpoint #361

Closed dongsam closed 2 years ago

dongsam commented 2 years ago

Description

Add /mint/v1beta1/last_block_time endpoint to get last_block_time by grpc The mint module stores last_block_time in blocks for inflation calculation but has not provided endpoints so far. Currently, in order to obtain a specific block time, a call must be made by rpc, but it can be obtained through grpc query by opening the corresponding endpoint.


Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.

hallazzang commented 2 years ago

I'm wondering why the last block time should also be exposed through gRPC.

dongsam commented 2 years ago

I'm wondering why the last block time should also be exposed through gRPC.

@hallazzang

As an example, we need to know the block time of every block to calculate the uptime in market maker scoring system, where it is much more efficient to call the only last block time with gRPC than to get the whole block information through tendermint rpc and parse the block time