Skip to content

Commit

Permalink
companion for cord
Browse files Browse the repository at this point in the history
Signed-off-by: Amar Tumballi <amar@dhiway.com>
  • Loading branch information
amarts committed Mar 3, 2024
1 parent 1dda133 commit 88e2d8f
Show file tree
Hide file tree
Showing 9 changed files with 658 additions and 546 deletions.
52 changes: 0 additions & 52 deletions packages/augment-api/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ declare module '@polkadot/api-base/types/consts' {
* The maximum number of individual freeze locks that can exist on an account at any time.
**/
maxFreezes: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of holds that can exist on an account at any time.
**/
maxHolds: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of locks that should exist on an account.
* Not strictly enforced, but used for weight estimation.
Expand Down Expand Up @@ -197,54 +193,6 @@ declare module '@polkadot/api-base/types/consts' {
**/
deposit: u128 & AugmentedConst<ApiType>;
};
mixnet: {
/**
* The maximum number of authorities per session.
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of external addresses for a mixnode.
**/
maxExternalAddressesPerMixnode: u32 & AugmentedConst<ApiType>;
/**
* The maximum size of one of a mixnode's external addresses.
**/
maxExternalAddressSize: u32 & AugmentedConst<ApiType>;
/**
* Minimum number of mixnodes. If there are fewer than this many mixnodes registered for a
* session, the mixnet will not be active during the session.
**/
minMixnodes: u32 & AugmentedConst<ApiType>;
/**
* Length of the first phase of each session (`CoverToCurrent`), in blocks.
**/
numCoverToCurrentBlocks: u32 & AugmentedConst<ApiType>;
/**
* Length of the third phase of each session (`CoverToPrev`), in blocks.
**/
numCoverToPrevBlocks: u32 & AugmentedConst<ApiType>;
/**
* The number of "slack" blocks at the end of each session.
* [`maybe_register`](Pallet::maybe_register) will try to register before this slack
* period, but may post registration transactions during the slack period as a last
* resort.
**/
numRegisterEndSlackBlocks: u32 & AugmentedConst<ApiType>;
/**
* The number of "slack" blocks at the start of each session, during which
* [`maybe_register`](Pallet::maybe_register) will not attempt to post registration
* transactions.
**/
numRegisterStartSlackBlocks: u32 & AugmentedConst<ApiType>;
/**
* Length of the second phase of each session (`RequestsToCurrent`), in blocks.
**/
numRequestsToCurrentBlocks: u32 & AugmentedConst<ApiType>;
/**
* Priority of unsigned transactions used to register mixnodes.
**/
registrationPriority: u64 & AugmentedConst<ApiType>;
};
multisig: {
/**
* The base amount of currency needed to reserve for creating a multisig execution or to
Expand Down
18 changes: 17 additions & 1 deletion packages/augment-api/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ declare module '@polkadot/api-base/types/errors' {
* Beneficiary account must pre-exist.
**/
DeadAccount: AugmentedError<ApiType>;
/**
* The delta cannot be zero.
**/
DeltaZero: AugmentedError<ApiType>;
/**
* Value too low to create account due to existential deposit.
**/
Expand All @@ -143,6 +147,10 @@ declare module '@polkadot/api-base/types/errors' {
* Balance too low to send value.
**/
InsufficientBalance: AugmentedError<ApiType>;
/**
* The issuance cannot be modified since it is already deactivated.
**/
IssuanceDeactivated: AugmentedError<ApiType>;
/**
* Account liquidity restrictions prevent withdrawal.
**/
Expand All @@ -152,7 +160,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
TooManyFreezes: AugmentedError<ApiType>;
/**
* Number of holds exceed `MaxHolds`.
* Number of holds exceed `VariantCountOf<T::RuntimeHoldReason>`.
**/
TooManyHolds: AugmentedError<ApiType>;
/**
Expand Down Expand Up @@ -1079,11 +1087,19 @@ declare module '@polkadot/api-base/types/errors' {
* There is a non-zero reference count preventing the account from being purged.
**/
NonZeroRefCount: AugmentedError<ApiType>;
/**
* No upgrade authorized.
**/
NothingAuthorized: AugmentedError<ApiType>;
/**
* The specification version is not allowed to decrease between the current runtime
* and the new runtime.
**/
SpecVersionNeedsToIncrease: AugmentedError<ApiType>;
/**
* The submitted code is not authorized.
**/
Unauthorized: AugmentedError<ApiType>;
};
technicalCommittee: {
/**
Expand Down
25 changes: 23 additions & 2 deletions packages/augment-api/src/interfaces/augment-api-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import '@polkadot/api-base/types/events';

import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportTokensMiscBalanceStatus, PalletAssetAssetStatusOf, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, SpConsensusGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup'
import type { FrameSupportDispatchDispatchInfo, FrameSupportTokensMiscBalanceStatus, PalletAssetAssetStatusOf, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, SpConsensusGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';

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

Expand Down Expand Up @@ -138,6 +138,10 @@ declare module '@polkadot/api-base/types/events' {
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* The `TotalIssuance` was forcefully changed.
**/
TotalIssuanceForced: AugmentedEvent<ApiType, [old: u128, new_: u128], { old: u128, new_: u128 }>;
/**
* Transfer succeeded.
**/
Expand Down Expand Up @@ -545,6 +549,19 @@ declare module '@polkadot/api-base/types/events' {
* The given task can never be executed since it is overweight.
**/
PermanentlyOverweight: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<U8aFixed>], { task: ITuple<[u32, u32]>, id: Option<U8aFixed> }>;
/**
* Cancel a retry configuration for some task.
**/
RetryCancelled: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<U8aFixed>], { task: ITuple<[u32, u32]>, id: Option<U8aFixed> }>;
/**
* The given task was unable to be retried since the agenda is full at that block or there
* was not enough weight to reschedule it.
**/
RetryFailed: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<U8aFixed>], { task: ITuple<[u32, u32]>, id: Option<U8aFixed> }>;
/**
* Set a retry configuration for some task.
**/
RetrySet: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<U8aFixed>, period: u32, retries: u8], { task: ITuple<[u32, u32]>, id: Option<U8aFixed>, period: u32, retries: u8 }>;
/**
* Scheduled some task.
**/
Expand Down Expand Up @@ -655,6 +672,10 @@ declare module '@polkadot/api-base/types/events' {
* On on-chain remark happened.
**/
Remarked: AugmentedEvent<ApiType, [sender: AccountId32, hash_: H256], { sender: AccountId32, hash_: H256 }>;
/**
* An upgrade was authorized.
**/
UpgradeAuthorized: AugmentedEvent<ApiType, [codeHash: H256, checkVersion: bool], { codeHash: H256, checkVersion: bool }>;
};
technicalCommittee: {
/**
Expand Down
44 changes: 19 additions & 25 deletions packages/augment-api/src/interfaces/augment-api-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { BTreeSet, Bytes, Null, Option, U8aFixed, Vec, bool, u128, u32, u64
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import type { AccountId32, Call, H256 } from '@polkadot/types/interfaces/runtime';
import type { CordIdentifierEventEntry, CordIdentifierIdentifierTypeOf, CordRuntimeSessionKeys, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAssetAssetDistributionEntry, PalletAssetAssetEntry, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmountRuntimeFreezeReason, PalletBalancesIdAmountRuntimeHoldReason, PalletBalancesReserveData, PalletChainSpaceSpaceAuthorization, PalletChainSpaceSpaceDetails, PalletCollectiveVotes, PalletDidDidDetails, PalletDidNameDidNameDidNameOwnership, PalletDidServiceEndpointsDidEndpoint, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineSr25519AppSr25519Public, PalletMixnetBoundedMixnode, PalletMultisigMultisig, PalletNetworkMembershipMemberData, PalletNetworkScoreAggregatedEntryOf, PalletNetworkScoreRatingEntry, PalletNetworkScoreRatingTypeOf, PalletNodeAuthorizationNodeInfo, PalletPreimageOldRequestStatus, PalletPreimageRequestStatus, PalletSchedulerScheduled, PalletSchemaSchemaEntry, PalletStatementStatementDetails, PalletStatementStatementEntryStatus, PalletStatementStatementPresentationDetails, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpConsensusGrandpaAppPublic, SpCoreCryptoKeyTypeId, SpMixnetAppPublic, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { CordIdentifierEventEntry, CordIdentifierIdentifierTypeOf, CordRuntimeSessionKeys, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemCodeUpgradeAuthorization, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAssetAssetDistributionEntry, PalletAssetAssetEntry, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmountRuntimeFreezeReason, PalletBalancesIdAmountRuntimeHoldReason, PalletBalancesReserveData, PalletChainSpaceSpaceAuthorization, PalletChainSpaceSpaceDetails, PalletCollectiveVotes, PalletDidDidDetails, PalletDidNameDidNameDidNameOwnership, PalletDidServiceEndpointsDidEndpoint, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNetworkMembershipMemberData, PalletNetworkScoreAggregatedEntryOf, PalletNetworkScoreRatingEntry, PalletNetworkScoreRatingTypeOf, PalletNodeAuthorizationNodeInfo, PalletPreimageOldRequestStatus, PalletPreimageRequestStatus, PalletSchedulerRetryConfig, PalletSchedulerScheduled, PalletSchemaSchemaEntry, PalletStatementStatementDetails, PalletStatementStatementEntryStatus, PalletStatementStatementPresentationDetails, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpConsensusGrandpaAppPublic, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';

export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
Expand Down Expand Up @@ -367,6 +367,16 @@ declare module '@polkadot/api-base/types/storage' {
**/
state: AugmentedQuery<ApiType, () => Observable<PalletGrandpaStoredState>, []>;
};
historical: {
/**
* Mapping from historical session indices to session-data root hash and validator count.
**/
historicalSessions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[H256, u32]>>>, [u32]>;
/**
* The range of historical sessions we store. [first, last)
**/
storedRange: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[u32, u32]>>>, []>;
};
identifier: {
identifiers: AugmentedQuery<ApiType, (arg1: Bytes | string | Uint8Array, arg2: CordIdentifierIdentifierTypeOf | 'Asset' | 'Auth' | 'ChainSpace' | 'Did' | 'Rating' | 'Registry' | 'Statement' | 'Schema' | 'Template' | number | Uint8Array) => Observable<Option<Vec<CordIdentifierEventEntry>>>, [Bytes, CordIdentifierIdentifierTypeOf]>;
};
Expand Down Expand Up @@ -416,30 +426,6 @@ declare module '@polkadot/api-base/types/storage' {
**/
accounts: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[AccountId32, u128, bool]>>>, [u32]>;
};
mixnet: {
/**
* Index of the current session. This may be offset relative to the session index tracked by
* eg `pallet_session`; mixnet session indices are independent.
**/
currentSessionIndex: AugmentedQuery<ApiType, () => Observable<u32>, []>;
/**
* Block in which the current session started.
**/
currentSessionStartBlock: AugmentedQuery<ApiType, () => Observable<u32>, []>;
/**
* Mixnode sets by session index. Only the mixnode sets for the previous, current, and next
* sessions are kept; older sets are discarded.
*
* The mixnodes in each set are keyed by authority index so we can easily check if an
* authority has registered a mixnode. The authority indices should only be used during
* registration; the authority indices for the very first session are made up.
**/
mixnodes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletMixnetBoundedMixnode>>, [u32, u32]>;
/**
* Authority list for the next session.
**/
nextAuthorityIds: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<SpMixnetAppPublic>>, [u32]>;
};
multisig: {
/**
* The set of open multisig operations.
Expand Down Expand Up @@ -527,6 +513,10 @@ declare module '@polkadot/api-base/types/storage' {
* identities.
**/
lookup: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [U8aFixed]>;
/**
* Retry configurations for items to be executed, indexed by task address.
**/
retries: AugmentedQuery<ApiType, (arg: ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<Option<PalletSchedulerRetryConfig>>, [ITuple<[u32, u32]>]>;
};
schema: {
/**
Expand Down Expand Up @@ -614,6 +604,10 @@ declare module '@polkadot/api-base/types/storage' {
* Total length (in bytes) for all extrinsics put together, for the current block.
**/
allExtrinsicsLen: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []>;
/**
* `Some` if a code upgrade has been authorized.
**/
authorizedUpgrade: AugmentedQuery<ApiType, () => Observable<Option<FrameSystemCodeUpgradeAuthorization>>, []>;
/**
* Map of block numbers to block hashes.
**/
Expand Down
Loading

0 comments on commit 88e2d8f

Please sign in to comment.