Skip to content

Commit

Permalink
Fix metadata spec
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul committed Oct 3, 2024
1 parent aee7ee5 commit b5577ac
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/types/src/metadata/Metadata.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import type { HexString } from '@polkadot/util/types';

import kusama from '@polkadot/types-support/metadata/static-kusama';
import polkadot from '@polkadot/types-support/metadata/static-polkadot';
import substrate from '@polkadot/types-support/metadata/static-substrate';
import kusama from '@polkadot/types-support/metadata/v15/kusama-hex';
import polkadot from '@polkadot/types-support/metadata/v15/polkadot-hex';
import substrate from '@polkadot/types-support/metadata/v15/substrate-hex';

import { TypeRegistry } from '../create/index.js';
import { Metadata } from './Metadata.js';
Expand All @@ -20,15 +20,15 @@ const allData: Record<string, HexString> = {

for (const type of ['kusama', 'polkadot', 'substrate'] as const) {
describe(`${type}metadata`, (): void => {
// const registry = new TypeRegistry();
// const opaqueMetadata = registry.createType('Option<OpaqueMetadata>', allData[type]).unwrap();
// const metadata = new Metadata(registry, opaqueMetadata.toHex());

// it('allows creation from hex', (): void => {
// expect(
// new Metadata(new TypeRegistry(), metadata.toHex()).toJSON()
// ).toEqual(metadata.toJSON());
// });
const registry = new TypeRegistry();
const opaqueMetadata = registry.createType('Option<OpaqueMetadata>', registry.createType('Raw', allData[type]).toU8a()).unwrap();
const metadata = new Metadata(registry, opaqueMetadata.toHex());

it('allows creation from hex', (): void => {
expect(
new Metadata(new TypeRegistry(), metadata.toHex()).toJSON()
).toEqual(metadata.toJSON());
});

// it('has a sane toCallsOnly', (): void => {

Check warning on line 33 in packages/types/src/metadata/Metadata.spec.ts

View workflow job for this annotation

GitHub Actions / pr (lint)

Some tests seem to be commented
// const test = metadata.asCallsOnly;
Expand Down

0 comments on commit b5577ac

Please sign in to comment.