doc: Update README.md with metadata retrieval instructions and testing caveats (#6156)
This commit is contained in:
@@ -49,7 +49,31 @@ To retrieve the runtime versions -
|
||||
|
||||
- Add it to the relevant folders e.g. `v14/{kusama, polkadot, substrate}-ver.ts`
|
||||
|
||||
NOTE: This all works for manual updating, but for an easier process run from root for each respective chain: `node ./scripts/metadata-get.mjs`
|
||||
## NOTE:
|
||||
|
||||
1. This all works for manual updating, but for an easier process run from root for each respective chain: `node ./scripts/metadata-get.mjs`.
|
||||
|
||||
2. If the chain is already live, running it locally is unnecessary — update the metadata & types using `node ./scripts/metadata-get.mjs --url <ws_chain_url>`.
|
||||
|
||||
3. Run `yarn test:one packages/types/src/metadata/v14` for Metadata checks
|
||||
|
||||
## Caveat
|
||||
|
||||
Occasionally, running the tests may result in a failure due to outdated metadata. The error message might look like this:
|
||||
|
||||
```bash
|
||||
/api/packages/types/src/metadata/v14/Metadata.spec.ts
|
||||
|
||||
undefined / undefined
|
||||
```
|
||||
|
||||
### How to Fix
|
||||
|
||||
1. Navigate to the file mentioned in the error.
|
||||
2. Paste the line `writeJson(json, version, type, 'json');` into the `try` block.
|
||||
3. Rerun the tests — they should pass now.
|
||||
4. **Important:** After verifying that the tests pass, revert your changes and run the tests again to ensure everything still works as expected.
|
||||
|
||||
|
||||
## extraction (Legacy)
|
||||
|
||||
@@ -67,4 +91,4 @@ To retrieve the metadata -
|
||||
|
||||
- Add it to the relevant folders e.g. `v14/{kusama, polkadot, substrate}-hex.json`
|
||||
- Run `yarn build:interfaces` to re-generate all TS
|
||||
- Run `yarn test:one packages/types/src/metadatra/v14` for Metadata checks
|
||||
- Run `yarn test:one packages/types/src/metadata/v14` for Metadata checks
|
||||
|
||||
Reference in New Issue
Block a user