regen-network / cosmos-modules

Other
10 stars 2 forks source link

Add query/result elements #64

Open alpe opened 4 years ago

alpe commented 4 years ago

I have added example types for pagination in queries and results. The problem persists that some protobuf types do not contain their identifier (for example Groups, Votes). We can wither work around this by using a wrapper type like Model in this draft or we add the IDs to the types when needed. As there are no actions on Votes me may not need an ID there. As a workflow example of a client that we should support:

  1. give me all proposals (that can be executed)
  2. execute proposal (with id=xx)

Without an ID in the query result from step 1 the second step would be impossible...

Another inconsistency is the type mismatch in queries and messages:

Prefix and Range queries feel a bit out of place with this RPC definition. They are quite powerful for receiving/ restoring state for a client but it is ok to hide them in the backend only. We can add more RPC functions instead to cover the cases.