Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata attribute to REST #352

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Galadrin
Copy link
Contributor

@Galadrin Galadrin commented May 13, 2023

Proposed changes

Add the possibility to query at a given block in the past
This feature is already avalable with gRPC but need to modify the interface for REST

This patch add the metadata attribute to the REST interface.
Call at height can be made using

metadata = (("x-cosmos-block-height", "123456"),)
bank.Balance(QueryBalanceRequest(address="account", denom="denom"), 
             metadata=metadata)

the metadata can also contain authentication, the metadata ar converted to headers in the REST request

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to stop working as expected)
  • Something else (e.g. tests, scripts, example, deployment, infrastructure, ...)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document.
  • I have based my branch, and I am making a pull request against, the main branch.
  • Checks and tests pass locally.

If applicable

  • I have added tests that prove my fix is effective or that my feature works.
  • I have checked that code coverage does not decrease.
  • I have added/updated the documentations.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did, what alternatives you considered, etc.

gRPC call can be made with headers to query at a given height
this header is provided to gRPC using `metadata` attribute.

This patch add the `metadata` attribute to the REST interface.
call can be made at height X using
```python
metadata = (("x-cosmos-block-height", "11095200"),)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant