Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
upgrade: test types
  • Loading branch information
Daniel Shiposha committed Aug 16, 2022
commit a5762ef0b03cf85aa5f61c2e307b1ded03edb1e8
10 changes: 8 additions & 2 deletions tests/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */

import type { ApiTypes } from '@polkadot/api-base/types';
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@polkadot/api-base/types/consts';

import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';

export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;

declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
interface AugmentedConsts<ApiType extends ApiTypes> {
balances: {
/**
* The minimum amount required to keep an account open.
Expand Down
15 changes: 13 additions & 2 deletions tests/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */

import type { ApiTypes } from '@polkadot/api-base/types';
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@polkadot/api-base/types/errors';

import type { ApiTypes, AugmentedError } from '@polkadot/api-base/types';

export type __AugmentedError<ApiType extends ApiTypes> = AugmentedError<ApiType>;

declare module '@polkadot/api-base/types/errors' {
export interface AugmentedErrors<ApiType extends ApiTypes> {
interface AugmentedErrors<ApiType extends ApiTypes> {
balances: {
/**
* Beneficiary account must pre-exist
Expand Down Expand Up @@ -652,6 +658,11 @@ declare module '@polkadot/api-base/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
treasury: {
/**
* The spend origin is valid but the amount it is allowed to spend is lower than the
* amount to be spent.
**/
InsufficientPermission: AugmentedError<ApiType>;
/**
* Proposer's balance is too low.
**/
Expand Down
41 changes: 31 additions & 10 deletions tests/src/interfaces/augment-api-events.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */

import type { ApiTypes } from '@polkadot/api-base/types';
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@polkadot/api-base/types/events';

import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';

export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;

declare module '@polkadot/api-base/types/events' {
export interface AugmentedEvents<ApiType extends ApiTypes> {
interface AugmentedEvents<ApiType extends ApiTypes> {
balances: {
/**
* A balance was set by root.
Expand Down Expand Up @@ -463,6 +469,17 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
transactionPayment: {
/**
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
* has been paid by `who`.
**/
TransactionFeePaid: AugmentedEvent<ApiType, [who: AccountId32, actualFee: u128, tip: u128], { who: AccountId32, actualFee: u128, tip: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
treasury: {
/**
* Some funds have been allocated.
Expand All @@ -488,6 +505,10 @@ declare module '@polkadot/api-base/types/events' {
* Spending has finished; this is the amount that rolls over until next spend.
**/
Rollover: AugmentedEvent<ApiType, [rolloverBalance: u128], { rolloverBalance: u128 }>;
/**
* A new spend proposal has been approved.
**/
SpendApproved: AugmentedEvent<ApiType, [proposalIndex: u32, amount: u128, beneficiary: AccountId32], { proposalIndex: u32, amount: u128, beneficiary: AccountId32 }>;
/**
* We have ended a spend period and will now allocate funds.
**/
Expand Down Expand Up @@ -602,35 +623,35 @@ declare module '@polkadot/api-base/types/events' {
/**
* Bad XCM format used.
**/
BadFormat: AugmentedEvent<ApiType, [Option<H256>]>;
BadFormat: AugmentedEvent<ApiType, [messageHash: Option<H256>], { messageHash: Option<H256> }>;
/**
* Bad XCM version used.
**/
BadVersion: AugmentedEvent<ApiType, [Option<H256>]>;
BadVersion: AugmentedEvent<ApiType, [messageHash: Option<H256>], { messageHash: Option<H256> }>;
/**
* Some XCM failed.
**/
Fail: AugmentedEvent<ApiType, [Option<H256>, XcmV2TraitsError]>;
Fail: AugmentedEvent<ApiType, [messageHash: Option<H256>, error: XcmV2TraitsError, weight: u64], { messageHash: Option<H256>, error: XcmV2TraitsError, weight: u64 }>;
/**
* An XCM exceeded the individual message weight budget.
**/
OverweightEnqueued: AugmentedEvent<ApiType, [u32, u32, u64, u64]>;
OverweightEnqueued: AugmentedEvent<ApiType, [sender: u32, sentAt: u32, index: u64, required: u64], { sender: u32, sentAt: u32, index: u64, required: u64 }>;
/**
* An XCM from the overweight queue was executed with the given actual weight used.
**/
OverweightServiced: AugmentedEvent<ApiType, [u64, u64]>;
OverweightServiced: AugmentedEvent<ApiType, [index: u64, used: u64], { index: u64, used: u64 }>;
/**
* Some XCM was executed ok.
**/
Success: AugmentedEvent<ApiType, [Option<H256>]>;
Success: AugmentedEvent<ApiType, [messageHash: Option<H256>, weight: u64], { messageHash: Option<H256>, weight: u64 }>;
/**
* An upward message was sent to the relay chain.
**/
UpwardMessageSent: AugmentedEvent<ApiType, [Option<H256>]>;
UpwardMessageSent: AugmentedEvent<ApiType, [messageHash: Option<H256>], { messageHash: Option<H256> }>;
/**
* An HRMP message was sent to a sibling parachain.
**/
XcmpMessageSent: AugmentedEvent<ApiType, [Option<H256>]>;
XcmpMessageSent: AugmentedEvent<ApiType, [messageHash: Option<H256>], { messageHash: Option<H256> }>;
/**
* Generic event
**/
Expand Down
15 changes: 13 additions & 2 deletions tests/src/interfaces/augment-api-query.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */

import type { ApiTypes } from '@polkadot/api-base/types';
// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@polkadot/api-base/types/storage';

import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types';
import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsTokenChild } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';

export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
export type __QueryableStorageEntry<ApiType extends ApiTypes> = QueryableStorageEntry<ApiType>;

declare module '@polkadot/api-base/types/storage' {
export interface AugmentedQueries<ApiType extends ApiTypes> {
interface AugmentedQueries<ApiType extends ApiTypes> {
balances: {
/**
* The Balances pallet example of storing the balance of an account.
Expand Down Expand Up @@ -362,6 +369,10 @@ declare module '@polkadot/api-base/types/storage' {
* by the system inherent.
**/
lastHrmpMqcHeads: AugmentedQuery<ApiType, () => Observable<BTreeMap<u32, H256>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The relay chain block number associated with the last parachain block.
**/
lastRelayChainBlockNumber: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Validation code that is set by the parachain and is to be communicated to collator and
* consequently the relay-chain.
Expand Down
28 changes: 21 additions & 7 deletions tests/src/interfaces/augment-api-rpc.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */

// import type lookup before we augment - in some environments
// this is required to allow for ambient/previous definitions
import '@polkadot/rpc-core/types/jsonrpc';

import type { PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsPartPartType, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionStats, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsRpcCollection, UpDataStructsTokenChild, UpDataStructsTokenData } from './default';
import type { AugmentedRpc } from '@polkadot/rpc-core/types';
import type { Metadata, StorageKey } from '@polkadot/types';
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec';
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, Codec } from '@polkadot/types-codec/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
Expand All @@ -15,7 +19,7 @@ import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
import type { BlockStats } from '@polkadot/types/interfaces/dev';
import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
Expand All @@ -27,8 +31,10 @@ import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockRespon
import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
import type { IExtrinsic, Observable } from '@polkadot/types/types';

export type __AugmentedRpc = AugmentedRpc<() => unknown>;

declare module '@polkadot/rpc-core/types/jsonrpc' {
export interface RpcInterface {
interface RpcInterface {
author: {
/**
* Returns true if the keystore has private keys for the given public key and key type.
Expand Down Expand Up @@ -57,11 +63,11 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
/**
* Submit and subscribe to watch an extrinsic until unsubscribed
**/
submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<ExtrinsicStatus>>;
submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ExtrinsicStatus>>;
/**
* Submit a fully formatted extrinsic for block inclusion
**/
submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<Hash>>;
submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Hash>>;
};
babe: {
/**
Expand Down Expand Up @@ -198,6 +204,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
* Estimate gas needed for execution of given contract.
**/
estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
/**
* Returns fee history for given block count & reward percentiles
**/
feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option<Vec<f64>> | null | Uint8Array | Vec<f64> | (f64)[]) => Observable<EthFeeHistory>>;
/**
* Returns current gas price.
**/
Expand Down Expand Up @@ -290,6 +300,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
* Returns the number of hashes per second that the node is mining with.
**/
hashrate: AugmentedRpc<() => Observable<U256>>;
/**
* Returns max priority fee per gas
**/
maxPriorityFeePerGas: AugmentedRpc<() => Observable<U256>>;
/**
* Returns true if client is actively mining new blocks.
**/
Expand Down Expand Up @@ -449,7 +463,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
/**
* Get Theme's keys values
**/
themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option<Vec<Text>> | null | object | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsTheme>>>;
themes: AugmentedRpc<(baseId: u32 | AnyNumber | Uint8Array, themeName: Text | string, keys: Option<Vec<Text>> | null | Uint8Array | Vec<Text> | (Text | string)[], at?: Hash | string | Uint8Array) => Observable<Option<RmrkTraitsTheme>>>;
};
rpc: {
/**
Expand Down Expand Up @@ -537,7 +551,7 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
/**
* Provides a way to trace the re-execution of a single block
**/
traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | object | string | Uint8Array, storageKeys: Option<Text> | null | object | string | Uint8Array, methods: Option<Text> | null | object | string | Uint8Array) => Observable<TraceBlockResponse>>;
traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | Uint8Array | Text | string, storageKeys: Option<Text> | null | Uint8Array | Text | string, methods: Option<Text> | null | Uint8Array | Text | string) => Observable<TraceBlockResponse>>;
/**
* Check current migration state
**/
Expand Down
Loading