From a99f848adbdf016b02044efefb8ff9b2affdaff8 Mon Sep 17 00:00:00 2001 From: Jaco Date: Wed, 5 Oct 2022 10:51:56 +0300 Subject: [PATCH] Cleanup WeightV2 comments (#5259) --- CHANGELOG.md | 2 ++ packages/types-known/src/spec/kusama.ts | 2 +- packages/types-known/src/spec/node-template.ts | 2 ++ packages/types-known/src/spec/node.ts | 2 ++ packages/types-known/src/spec/polkadot.ts | 2 +- packages/types-known/src/spec/rococo.ts | 2 +- packages/types-known/src/spec/westend.ts | 2 +- 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 967e7b3971..f44fc71de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master +- **Important** While the API witll detect and decorate the weight type based on V1 or V2, the default `Weight` type (used in runtime calls and RPCs) has not been swapped from the old `u64` variant. This means that on new chains using `WeightV2`, the TS decorated type will still reflect the old version. + Changes: - Adjust handling of `Weight` type for V2 structures diff --git a/packages/types-known/src/spec/kusama.ts b/packages/types-known/src/spec/kusama.ts index f561667792..dc16108546 100644 --- a/packages/types-known/src/spec/kusama.ts +++ b/packages/types-known/src/spec/kusama.ts @@ -207,7 +207,7 @@ const versioned: OverrideVersionedType[] = [ } }, { - // metadata v14 + // weight v2 introduction minmax: [9300, undefined], types: { Weight: 'WeightV2' diff --git a/packages/types-known/src/spec/node-template.ts b/packages/types-known/src/spec/node-template.ts index 1c641e26cd..e181381b50 100644 --- a/packages/types-known/src/spec/node-template.ts +++ b/packages/types-known/src/spec/node-template.ts @@ -10,6 +10,8 @@ const versioned: OverrideVersionedType[] = [ minmax: [0, undefined], types: { // nothing, API tracks master + // (v2 weights are not yet the default) + Weight: 'WeightV2' } } ]; diff --git a/packages/types-known/src/spec/node.ts b/packages/types-known/src/spec/node.ts index 1c641e26cd..e181381b50 100644 --- a/packages/types-known/src/spec/node.ts +++ b/packages/types-known/src/spec/node.ts @@ -10,6 +10,8 @@ const versioned: OverrideVersionedType[] = [ minmax: [0, undefined], types: { // nothing, API tracks master + // (v2 weights are not yet the default) + Weight: 'WeightV2' } } ]; diff --git a/packages/types-known/src/spec/polkadot.ts b/packages/types-known/src/spec/polkadot.ts index 9e6211b96d..4c599a88ec 100644 --- a/packages/types-known/src/spec/polkadot.ts +++ b/packages/types-known/src/spec/polkadot.ts @@ -81,7 +81,7 @@ const versioned: OverrideVersionedType[] = [ } }, { - // metadata v14 + // weight v2 introduction minmax: [9300, undefined], types: { Weight: 'WeightV2' diff --git a/packages/types-known/src/spec/rococo.ts b/packages/types-known/src/spec/rococo.ts index c79a724489..4410beddaa 100644 --- a/packages/types-known/src/spec/rococo.ts +++ b/packages/types-known/src/spec/rococo.ts @@ -55,7 +55,7 @@ const versioned: OverrideVersionedType[] = [ } }, { - // metadata v14 + // weight v2 introduction minmax: [9300, undefined], types: { Weight: 'WeightV2' diff --git a/packages/types-known/src/spec/westend.ts b/packages/types-known/src/spec/westend.ts index 1b13900021..020d60a3fd 100644 --- a/packages/types-known/src/spec/westend.ts +++ b/packages/types-known/src/spec/westend.ts @@ -98,7 +98,7 @@ const versioned: OverrideVersionedType[] = [ } }, { - // metadata v14 + // weight v2 introduction minmax: [9300, undefined], types: { Weight: 'WeightV2'