Refactor getReference in GQL #78

Open
opened 2023-01-11 06:58:05 +00:00 by 0xmuralik · 1 comment
0xmuralik commented 2023-01-11 06:58:05 +00:00 (Migrated from github.com)

Prior to the Record attribute typing, each CID value was reffered with a "/".
Ex: https://github.com/cerc-io/laconicd/blob/main/x/registry/helpers/examples/example1.yml

Now it's changed to https://github.com/cerc-io/laconicd/blob/main/x/registry/helpers/examples/service_provider_example.yml
Refactor getReferences to work with new types of attributes.

Prior to the Record attribute typing, each CID value was reffered with a "/". Ex: https://github.com/cerc-io/laconicd/blob/main/x/registry/helpers/examples/example1.yml Now it's changed to https://github.com/cerc-io/laconicd/blob/main/x/registry/helpers/examples/service_provider_example.yml Refactor [getReferences](https://github.com/cerc-io/laconicd/blob/ab2ea51aac6e3c26a41dd4028d8d5d8884e13b50/gql/util.go#L166) to work with new types of attributes.
0xmuralik commented 2023-03-16 11:16:53 +00:00 (Migrated from github.com)

This is solved in https://github.com/cerc-io/laconicd/pull/79#issuecomment-1461888831. But it still needs some refactoring to fetch nested references. For example, in the following record, only repo_reference CID is fetched and other refs which are nested further inside are ignored.

record:
  metadata:
    version: 0.32.0
    chain_reference: 
      /: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
  repo_reference:
    /: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
  wasm:
    hash_reference:
      /: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
    metadata:
      compiler_version: 1.15.0  
      execution_engine_version: 0.16.1
  version: 1.0.0
  type: WatcherRegistrationRecord
This is solved in https://github.com/cerc-io/laconicd/pull/79#issuecomment-1461888831. But it still needs some refactoring to fetch nested references. For example, in the following record, only `repo_reference` CID is fetched and other refs which are nested further inside are ignored. ``` record: metadata: version: 0.32.0 chain_reference: /: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 repo_reference: /: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D wasm: hash_reference: /: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR metadata: compiler_version: 1.15.0 execution_engine_version: 0.16.1 version: 1.0.0 type: WatcherRegistrationRecord ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/laconicd-deprecated#78
No description provided.