Rename Base -> AbstractBase (#4943)
This commit is contained in:
@@ -5,7 +5,7 @@ import type { Registry } from '@polkadot/types-codec/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
|
||||
import { Base } from '@polkadot/types-codec';
|
||||
import { AbstractBase } from '@polkadot/types-codec';
|
||||
import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { decodeAddress } from '@polkadot/util-crypto';
|
||||
|
||||
@@ -38,7 +38,7 @@ function decodeU8a (registry: Registry, value: Uint8Array): GenericEthereumAccou
|
||||
|
||||
const [offset, length] = GenericAccountIndex.readLength(value);
|
||||
|
||||
return registry.createTypeUnsafe('AccountIndex', [u8aToBn(value.subarray(offset, offset + length), true)]);
|
||||
return registry.createTypeUnsafe('AccountIndex', [u8aToBn(value.subarray(offset, offset + length))]);
|
||||
}
|
||||
|
||||
function decodeAddressOrIndex (registry: Registry, value: AnyAddress): GenericEthereumAccountId | GenericAccountIndex {
|
||||
@@ -61,7 +61,7 @@ function decodeAddressOrIndex (registry: Registry, value: AnyAddress): GenericEt
|
||||
* we extend from Base with an AccountId/AccountIndex wrapper. Basically the Address
|
||||
* is encoded as `[ <prefix-byte>, ...publicKey/...bytes ]` as per spec
|
||||
*/
|
||||
export class GenericEthereumLookupSource extends Base<GenericEthereumAccountId | GenericAccountIndex> {
|
||||
export class GenericEthereumLookupSource extends AbstractBase<GenericEthereumAccountId | GenericAccountIndex> {
|
||||
constructor (registry: Registry, value: AnyAddress = new Uint8Array()) {
|
||||
super(registry, decodeAddressOrIndex(registry, value));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { CallBase, ExtrinsicPayloadValue, ICompact, IExtrinsic, IKeyringPai
|
||||
import type { GenericExtrinsicEra } from './ExtrinsicEra';
|
||||
import type { ExtrinsicValueV4 } from './v4/Extrinsic';
|
||||
|
||||
import { Base } from '@polkadot/types-codec';
|
||||
import { AbstractBase } from '@polkadot/types-codec';
|
||||
import { assert, compactAddLength, compactFromU8a, compactToU8a, isHex, isU8a, objectProperty, objectSpread, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { BIT_SIGNED, BIT_UNSIGNED, DEFAULT_VERSION, UNMASK_VERSION } from './constants';
|
||||
@@ -76,7 +76,7 @@ function decodeU8a (registry: Registry, value: Uint8Array, version: number): Ext
|
||||
return newFromValue(registry, data.subarray(1), data[0]);
|
||||
}
|
||||
|
||||
abstract class ExtrinsicBase<A extends AnyTuple> extends Base<ExtrinsicVx | ExtrinsicUnknown> {
|
||||
abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicVx | ExtrinsicUnknown> {
|
||||
constructor (registry: Registry, value: ExtrinsicV4 | ExtrinsicUnknown, initialU8aLength?: number) {
|
||||
super(registry, value, initialU8aLength);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics';
|
||||
import type { Hash } from '../interfaces/runtime';
|
||||
import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber } from '../types';
|
||||
|
||||
import { Base, Raw } from '@polkadot/types-codec';
|
||||
import { AbstractBase, Raw } from '@polkadot/types-codec';
|
||||
import { u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { DEFAULT_VERSION } from './constants';
|
||||
@@ -43,7 +43,7 @@ function decodeExtrinsicPayload (registry: Registry, value?: GenericExtrinsicPay
|
||||
* A signing payload for an [[Extrinsic]]. For the final encoding, it is variable length based
|
||||
* on the contents included
|
||||
*/
|
||||
export class GenericExtrinsicPayload extends Base<ExtrinsicPayloadVx> {
|
||||
export class GenericExtrinsicPayload extends AbstractBase<ExtrinsicPayloadVx> {
|
||||
constructor (registry: Registry, value?: Partial<ExtrinsicPayloadValue> | Uint8Array | string, { version }: ExtrinsicPayloadOptions = {}) {
|
||||
super(registry, decodeExtrinsicPayload(registry, value as ExtrinsicPayloadValue, version));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Inspect, Registry } from '@polkadot/types-codec/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
|
||||
import { Base } from '@polkadot/types-codec';
|
||||
import { AbstractBase } from '@polkadot/types-codec';
|
||||
import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { decodeAddress } from '@polkadot/util-crypto';
|
||||
|
||||
@@ -38,7 +38,7 @@ function decodeU8a (registry: Registry, value: Uint8Array): GenericAccountId | G
|
||||
|
||||
const [offset, length] = GenericAccountIndex.readLength(value);
|
||||
|
||||
return registry.createTypeUnsafe('AccountIndex', [u8aToBn(value.subarray(offset, offset + length), true)]);
|
||||
return registry.createTypeUnsafe('AccountIndex', [u8aToBn(value.subarray(offset, offset + length))]);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@@ -62,7 +62,7 @@ function decodeAddressOrIndex (registry: Registry, value: AnyAddress): GenericAc
|
||||
* we extend from Base with an AccountId/AccountIndex wrapper. Basically the Address
|
||||
* is encoded as `[ <prefix-byte>, ...publicKey/...bytes ]` as per spec
|
||||
*/
|
||||
export class GenericLookupSource extends Base<GenericAccountId | GenericAccountIndex> {
|
||||
export class GenericLookupSource extends AbstractBase<GenericAccountId | GenericAccountIndex> {
|
||||
constructor (registry: Registry, value: AnyAddress = new Uint8Array()) {
|
||||
super(registry, decodeAddressOrIndex(registry, value));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user