Skip to content

Draft: [SDAO-297] morley-client: Extend NodeMethods so specific blocks can be queried

Simon Jakobi requested to merge sjakobi/generalize-node-api into master

Description

Problem: For SDAO-297, we need to query big maps and contract storage at specific blocks.

Solution:

  • NodeMethods is extended with new methods getStorageAtBlock and getBigMapValueAtBlock
  • A BlockId type is added that represents different types of block IDs.

Related issue(s)

https://issues.serokell.io/issue/SDAO-297

TODOs (please discuss)

  • For consistency, the Text arguments in getBlockConstants and getHeadBlockOperations are changed to BlockIds
  • To avoid confusion, getHeadBlockOperations is renamed to getBlockOperations
  • For consistency, the remaining methods that are currently specialized to query the head block are generalized to take a BlockId argument
  • To avoid unnecessary growth in NodeMethods, turn "non-primitive" methods like getStorage and getBigMapValue into top-level definitions

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Simon Jakobi

Merge request reports

Loading