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

feat!: support for NStorageMaps #1053

Merged
merged 4 commits into from
Sep 28, 2022
Merged

feat!: support for NStorageMaps #1053

merged 4 commits into from
Sep 28, 2022

Conversation

TarikGul
Copy link
Member

@TarikGul TarikGul commented Sep 10, 2022

closes: #811

Breaking Change - /pallets/{palletid}/storage/{storageId}

The current endpoint accepts two query parameters key1, and key2. It is now updated to accept an array query param called keys that accepts and N amount of keys. ORDER MATTERS. The order in which the keys are inputted is the order they will be inputted into the storage query.

Example:
/pallets/Staking/storage/ErasValidatorPrefs?keys[]=0x00&keys[]=0x01

The response will no longer have key1 and key2 but will now have a keys field that returns an array of the keys..

Example:

{
  "at": {
    "hash": "0x7b713de604a99857f6c25eacc115a4f28d2611a23d9ddff99ab0e4f1c17a8578",
    "height": "789629"
  },
  "pallet": "staking",
  "palletIndex": "15",
  "storageItem": "erasValidatorPrefs",
  "keys": ["0x00", "0x01"],
  "value": ...
}

Changes (notes) - /pallets/{palletid}/storage/{storageId}

Query Params

Removed:
key1 and key2

Added - Order matters
keys - Needs to be formatted like: ?keys[]=<key1>&keys[]=<key2>&keys[]=<key3>

Response

Removed:
key1 and key2

Added
keys - Array

Todo

  • Docs

@TarikGul TarikGul requested a review from a team as a code owner September 10, 2022 19:47
@TarikGul TarikGul self-assigned this Sep 10, 2022
Copy link
Contributor

@CurlyBracketEffect CurlyBracketEffect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like watching a skilled surgeon at work. Just have that one question about the 'unkown' values.

Copy link
Collaborator

@marshacb marshacb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

This pull request was closed.
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.

Query support for StorageNMaps
3 participants