fix bigint type (#3869)

This commit is contained in:
Nantian
2021-08-12 10:02:15 +02:00
committed by GitHub
parent 4ce01fe16f
commit db6c44615f
13 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ describe('Date', (): void => {
});
describe('encode', (): void => {
const testEncode = (to: 'toBigInt' | 'toBn' | 'toISOString' | 'toNumber' | CodecTo, expected: BigInt | BN | number | string | Uint8Array): void =>
const testEncode = (to: 'toBigInt' | 'toBn' | 'toISOString' | 'toNumber' | CodecTo, expected: bigint | BN | number | string | Uint8Array): void =>
it(`can encode ${to}`, (): void => {
expect(new CodecDate(registry, 421)[to]()).toEqual(expected);
});
+1 -1
View File
@@ -12,7 +12,7 @@ import { GenericAccountIndex } from '../generic/AccountIndex';
import { GenericEthereumAccountId } from './AccountId';
// eslint-disable-next-line no-use-before-define
type AnyAddress = BigInt | BN | GenericEthereumLookupSource | GenericEthereumAccountId | GenericAccountIndex | number[] | Uint8Array | number | string;
type AnyAddress = bigint | BN | GenericEthereumLookupSource | GenericEthereumAccountId | GenericAccountIndex | number[] | Uint8Array | number | string;
export const ACCOUNT_ID_PREFIX = new Uint8Array([0xff]);
+1 -1
View File
@@ -17,7 +17,7 @@ const MAX_2BYTE = new BN(1).shln(16);
const MAX_4BYTE = new BN(1).shln(32);
/** @internal */
function decodeAccountIndex (value: AnyNumber): BN | BigInt | Uint8Array | number | string {
function decodeAccountIndex (value: AnyNumber): BN | bigint | Uint8Array | number | string {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
if (value instanceof GenericAccountIndex) {
// `value.toBn()` on AccountIndex returns a pure BN (i.e. not an
+1 -1
View File
@@ -12,7 +12,7 @@ import { GenericAccountId } from './AccountId';
import { GenericAccountIndex } from './AccountIndex';
// eslint-disable-next-line no-use-before-define
type AnyAddress = BigInt | BN | GenericLookupSource | GenericAccountId | GenericAccountIndex | number[] | Uint8Array | number | string;
type AnyAddress = bigint | BN | GenericLookupSource | GenericAccountId | GenericAccountIndex | number[] | Uint8Array | number | string;
export const ACCOUNT_ID_PREFIX = new Uint8Array([0xff]);
@@ -30,7 +30,7 @@ interface IterFn {
meta: StorageEntryMetadataLatest;
}
type Arg = boolean | string | number | null | BN | BigInt | Uint8Array | Codec;
type Arg = boolean | string | number | null | BN | bigint | Uint8Array | Codec;
/** @internal */
function createKeyRaw (registry: Registry, itemFn: CreateItemFn, keys: Type[], hashers: StorageHasher[], args: Arg[]): Uint8Array {
+1 -1
View File
@@ -9,7 +9,7 @@ export type AnyJson = string | number | boolean | null | undefined | AnyJson[] |
export type AnyFunction = (...args: any[]) => any;
export type AnyNumber = BN | BigInt | Uint8Array | number | string;
export type AnyNumber = BN | bigint | Uint8Array | number | string;
export type AnyString = string | string;