Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Migrate schema resolution of 'useModuleSchemaRpc' to Web SDK #66

Open
bisgardo opened this issue Apr 17, 2024 · 1 comment
Open

Migrate schema resolution of 'useModuleSchemaRpc' to Web SDK #66

bisgardo opened this issue Apr 17, 2024 · 1 comment
Labels
[Project] react-components [Type] Task An additional feature or improvement.

Comments

@bisgardo
Copy link
Contributor

bisgardo commented Apr 17, 2024

The hook was added in #46.

This work is already in progress: Concordium/concordium-node-sdk-js#233

@bisgardo bisgardo added the [Type] Task An additional feature or improvement. label Apr 17, 2024
bisgardo added a commit to Concordium/concordium-node-sdk-js that referenced this issue Apr 26, 2024
#233)

## Purpose

Ensure that `getEmbeddedSchema` (on `ConcordiumGRPCClient`) is able to resolve legacy schemas (i.e. schemas without embedded versions).

Also make parsing of contract schema more precise based by using the module version information that is now exposed by the gRPC client. This in turn also documents the relationship between module and schema versions.

## Changes

The module version is now used to determine what custom sections to look for. Added comments explain the expected results.

The extraction code is migrated from the dapp-library [`@concordium/react-components`](https://github.com/Concordium/concordium-dapp-libraries/blob/a045f3b8bc11c7389190c789072f313686b6c639/packages/react-components/src/useModuleSchemaRpc.ts). Specifically, the contents of function `getEmbeddedModuleSchema` was replaced with the contents of `findSchema` and its helper function `findCustomSections` was added and adjusted to use the SDK types.

Finally, `getEmbeddedModuleSchema` was made non-async and `wasmToSchema` removed because it was nothing but a more limited version of `getEmbeddedModuleSchema`.

Addresses Concordium/concordium-dapp-libraries#66.
@bisgardo
Copy link
Contributor Author

This change can be done once Web SDK v8 has been released.

@soerenbf soerenbf added the [Prio] Medium A core functionality is compromised. Workaround available. label Jun 4, 2024 — with Linear
@soerenbf soerenbf removed the [Prio] Medium A core functionality is compromised. Workaround available. label Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
[Project] react-components [Type] Task An additional feature or improvement.
Projects
None yet
Development

No branches or pull requests

2 participants