From 5d0cde2a7c7cdc75f6d2de61a382ef117139626c Mon Sep 17 00:00:00 2001 From: Harry Solovay Date: Wed, 17 May 2023 11:07:22 -0400 Subject: [PATCH] rename page prop count to limit --- Readme.md | 2 +- examples/dynamic.eg.ts | 2 +- examples/paginate.eg.ts | 4 ++-- fluent/StorageRune.ts | 4 ++-- patterns/multisig/MultisigRune.ts | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Readme.md b/Readme.md index bd8c3696a..2c05c893d 100644 --- a/Readme.md +++ b/Readme.md @@ -98,7 +98,7 @@ Retrieve the first 10 entries from a storage map of Polkadot. ```ts import { polkadot } from "@capi/polkadot" -const accounts = await polkadot.System.Account.entries({ count: 10 }).run() +const accounts = await polkadot.System.Account.entries({ limit: 10 }).run() ``` ## Development Networks diff --git a/examples/dynamic.eg.ts b/examples/dynamic.eg.ts index 3aa647aee..5a34ed59c 100644 --- a/examples/dynamic.eg.ts +++ b/examples/dynamic.eg.ts @@ -26,7 +26,7 @@ const Account = System.storage("Account") /// Read the first ten entries of the `Account` storage map. /// Note how the lack of partial key is communicated via `null`. -const entries = await Account.entries({ count: 10 }).run() +const entries = await Account.entries({ limit: 10 }).run() /// The result should contain a `[Uint8Array, AccountInfo]` tuple of length 10. console.log("Entries page:", entries) diff --git a/examples/paginate.eg.ts b/examples/paginate.eg.ts index 3c2cf51f8..227198ce7 100644 --- a/examples/paginate.eg.ts +++ b/examples/paginate.eg.ts @@ -8,14 +8,14 @@ import { $accountInfo, polkadotDev } from "@capi/polkadot-dev" import { $ } from "capi" // Reference the first 10 keys of a polkadot dev chain's system account map. -const accountKeys = await polkadotDev.System.Account.keys({ count: 10 }).run() +const accountKeys = await polkadotDev.System.Account.keys({ limit: 10 }).run() /// Each key should be of type `Uint8Array`. console.log("Account keys:", accountKeys) $.assert($.sizedArray($.uint8Array, 10), accountKeys) // Reference the first 10 key-value pairs of a polkadot dev chain's system account map. -const accountEntries = await polkadotDev.System.Account.entries({ count: 10 }).run() +const accountEntries = await polkadotDev.System.Account.entries({ limit: 10 }).run() /// Each entry should be of type `[Uint8Array, AccountInfo]` console.log("Account entries:", accountEntries) diff --git a/fluent/StorageRune.ts b/fluent/StorageRune.ts index 2717038b7..5db2a2bc9 100644 --- a/fluent/StorageRune.ts +++ b/fluent/StorageRune.ts @@ -105,7 +105,7 @@ export class StorageRune< return this.chain.connection.call( "state_getKeysPaged", storageKey, - Rune.resolve(props.count).handle(undefined, () => Rune.constant(100)), + Rune.resolve(props.limit).handle(undefined, () => Rune.constant(100)), startKey, this.chain.blockHash(blockHash), ) @@ -127,7 +127,7 @@ export interface StoragePageProps< out P extends Chain.PalletName, out S extends Chain.StorageName, > { - count?: number + limit?: number partialKey?: Chain.Storage.PartialKey start?: Chain.Storage.Key } diff --git a/patterns/multisig/MultisigRune.ts b/patterns/multisig/MultisigRune.ts index 174d743d2..1fcea5bd6 100644 --- a/patterns/multisig/MultisigRune.ts +++ b/patterns/multisig/MultisigRune.ts @@ -131,11 +131,11 @@ export class MultisigRune extends PatternRune( - ...[count, blockHash]: RunicArgs + ...[limit, blockHash]: RunicArgs ): ValueRune[], RunicArgs.U | U> { const partialKey = Rune.tuple([this.accountId]) return this.storage.keys({ - count, + limit, partialKey: partialKey as never, }, blockHash) as never }