Jelajahi Sumber

Fix mappings/tests after Olympia runtime changes

Leszek Wiesner 4 tahun lalu
induk
melakukan
846f04c36e

+ 1 - 1
query-node/mappings/init.ts

@@ -19,7 +19,7 @@ async function init() {
   const membershipSystem = new MembershipSystem({
     defaultInviteCount: initialInvitationCount.toNumber(),
     membershipPrice,
-    referralCut,
+    referralCut: referralCut.toNumber(),
     invitedInitialBalance: initialInvitationBalance,
   })
   await db.save<MembershipSystem>(membershipSystem)

+ 3 - 3
query-node/mappings/mappings.ts

@@ -356,15 +356,15 @@ export async function members_MembershipPriceUpdated(db: DatabaseManager, event_
 }
 
 export async function members_ReferralCutUpdated(db: DatabaseManager, event_: SubstrateEvent): Promise<void> {
-  const { balance: newReferralCut } = new Members.ReferralCutUpdatedEvent(event_).data
+  const { u8: newReferralCut } = new Members.ReferralCutUpdatedEvent(event_).data
   const membershipSystem = await getMembershipSystem(db)
-  membershipSystem.referralCut = newReferralCut
+  membershipSystem.referralCut = newReferralCut.toNumber()
 
   await db.save<MembershipSystem>(membershipSystem)
 
   const referralCutUpdatedEvent = new ReferralCutUpdatedEvent({
     event: createEvent(event_, EventType.ReferralCutUpdated),
-    newValue: newReferralCut,
+    newValue: newReferralCut.toNumber(),
   })
 
   await db.save<Event>(referralCutUpdatedEvent.event)

+ 3 - 3
query-node/schema.graphql

@@ -85,8 +85,8 @@ type MembershipSystem @entity {
   "Current price to buy a membership."
   membershipPrice: BigInt!
 
-  "Amount of tokens diverted to invitor."
-  referralCut: BigInt!
+  "Percentage of tokens diverted to invitor."
+  referralCut: Int!
 
   "The initial, locked, balance credited to controller account of invitee."
   invitedInitialBalance: BigInt!
@@ -222,7 +222,7 @@ type ReferralCutUpdatedEvent @entity {
   member: Membership!
 
   "New cut value."
-  newValue: BigInt!
+  newValue: Int!
 }
 
 type InvitesTransferredEvent @entity {

+ 11 - 2
tests/integration-tests/src/Api.ts

@@ -126,13 +126,18 @@ export class Api {
   }
 
   // Create new keys and store them in the shared keyring
-  public createKeyPairs(n: number): KeyringPair[] {
+  public async createKeyPairs(n: number, withExistentialDeposit = true): Promise<KeyringPair[]> {
     const nKeyPairs: KeyringPair[] = []
     for (let i = 0; i < n; i++) {
       // What are risks of generating duplicate keys this way?
       // Why not use a deterministic /TestKeys/N and increment N
       nKeyPairs.push(this.keyring.addFromUri(i + uuid().substring(0, 8)))
     }
+    if (withExistentialDeposit) {
+      await Promise.all(
+        nKeyPairs.map(({ address }) => this.treasuryTransferBalance(address, this.existentialDeposit()))
+      )
+    }
     return nKeyPairs
   }
 
@@ -204,11 +209,15 @@ export class Api {
   }
 
   // This method does not take into account weights and the runtime weight to fees computation!
-  public async estimateTxFee(tx: SubmittableExtrinsic<'promise'>, account: string): Promise<BN> {
+  public async estimateTxFee(tx: SubmittableExtrinsic<'promise'>, account: string): Promise<Balance> {
     const paymentInfo = await tx.paymentInfo(account)
     return paymentInfo.partialFee
   }
 
+  public existentialDeposit(): Balance {
+    return this.api.consts.balances.existentialDeposit
+  }
+
   // TODO: Augmentations comming with new @polkadot/typegen!
 
   public findEventRecord(events: EventRecord[], section: string, method: string): EventRecord | undefined {

+ 11 - 6
tests/integration-tests/src/fixtures/membershipModule.ts

@@ -137,8 +137,8 @@ export class BuyMembershipHappyCaseFixture extends MembershipFixture implements
 
   async execute(): Promise<void> {
     // Fee estimation and transfer
-    const membershipFee: BN = await this.api.getMembershipFee()
-    const membershipTransactionFee: BN = await this.api.estimateTxFee(
+    const membershipFee = await this.api.getMembershipFee()
+    const membershipTransactionFee = await this.api.estimateTxFee(
       this.generateBuyMembershipTx(this.accounts[0]),
       this.accounts[0]
     )
@@ -306,13 +306,18 @@ export class UpdateAccountsHappyCaseFixture extends MembershipFixture {
   private newRootAccount: string
   private newControllerAccount: string
 
-  public constructor(api: Api, query: QueryNodeApi, memberContext: MemberContext) {
+  public constructor(
+    api: Api,
+    query: QueryNodeApi,
+    memberContext: MemberContext,
+    newRootAccount: string,
+    newControllerAccount: string
+  ) {
     super(api)
     this.query = query
     this.memberContext = memberContext
-    const [newRootAccount, newControllerAccount] = this.api.createKeyPairs(2)
-    this.newRootAccount = newRootAccount.address
-    this.newControllerAccount = newControllerAccount.address
+    this.newRootAccount = newRootAccount
+    this.newControllerAccount = newControllerAccount
   }
 
   private assertAccountsUpdateSuccesful(qMember?: QueryNodeMembership | null) {

+ 2 - 2
tests/integration-tests/src/flows/membership/creatingMemberships.ts

@@ -17,12 +17,12 @@ export default async function membershipCreation({ api, query, env }: FlowProps)
   assert(N > 0)
 
   // Assert membership can be bought if sufficient funds are available
-  const nAccounts = api.createKeyPairs(N).map((key) => key.address)
+  const nAccounts = (await api.createKeyPairs(N)).map((key) => key.address)
   const happyCaseFixture = new BuyMembershipHappyCaseFixture(api, query, nAccounts)
   await new FixtureRunner(happyCaseFixture).run()
 
   // Assert account can not buy the membership with insufficient funds
-  const aAccount = api.createKeyPairs(1)[0].address
+  const aAccount = (await api.createKeyPairs(1))[0].address
   const insufficientFundsFixture = new BuyMembershipWithInsufficienFundsFixture(api, aAccount)
   await new FixtureRunner(insufficientFundsFixture).run()
 

+ 2 - 2
tests/integration-tests/src/flows/membership/invitingMembers.ts

@@ -13,12 +13,12 @@ export default async function membershipCreation({ api, query, env }: FlowProps)
   const N: number = +env.MEMBERS_INVITE_N!
   assert(N > 0)
 
-  const [inviterAcc] = api.createKeyPairs(1).map((key) => key.address)
+  const [inviterAcc] = (await api.createKeyPairs(1)).map((key) => key.address)
   const buyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture(api, query, [inviterAcc])
   await new FixtureRunner(buyMembershipHappyCaseFixture).run()
   const [inviterMemberId] = buyMembershipHappyCaseFixture.getCreatedMembers()
 
-  const inviteesAccs = api.createKeyPairs(N).map((key) => key.address)
+  const inviteesAccs = (await api.createKeyPairs(N)).map((key) => key.address)
   const inviteMembersHappyCaseFixture = new InviteMembersHappyCaseFixture(
     api,
     query,

+ 2 - 2
tests/integration-tests/src/flows/membership/managingStakingAccounts.ts

@@ -14,7 +14,7 @@ export default async function membershipCreation({ api, query, env }: FlowProps)
   debug('Started')
   api.enableDebugTxLogs()
 
-  const [account] = api.createKeyPairs(1).map((key) => key.address)
+  const [account] = (await api.createKeyPairs(1)).map((key) => key.address)
   const buyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture(api, query, [account])
   await new FixtureRunner(buyMembershipHappyCaseFixture).run()
   const [memberId] = buyMembershipHappyCaseFixture.getCreatedMembers()
@@ -22,7 +22,7 @@ export default async function membershipCreation({ api, query, env }: FlowProps)
   const N: number = +env.STAKING_ACCOUNTS_ADD_N!
   assert(N > 0)
 
-  const stakingAccounts = api.createKeyPairs(N).map((k) => k.address)
+  const stakingAccounts = (await api.createKeyPairs(N)).map((k) => k.address)
   const addStakingAccountsHappyCaseFixture = new AddStakingAccountsHappyCaseFixture(
     api,
     query,

+ 1 - 1
tests/integration-tests/src/flows/membership/transferringInvites.ts

@@ -9,7 +9,7 @@ export default async function membershipCreation({ api, query, env }: FlowProps)
   debug('Started')
   api.enableDebugTxLogs()
 
-  const [fromAcc, toAcc] = api.createKeyPairs(2).map((key) => key.address)
+  const [fromAcc, toAcc] = (await api.createKeyPairs(2)).map((key) => key.address)
   const buyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture(api, query, [fromAcc, toAcc])
   await new FixtureRunner(buyMembershipHappyCaseFixture).run()
   const [fromMemberId, toMemberId] = buyMembershipHappyCaseFixture.getCreatedMembers()

+ 12 - 5
tests/integration-tests/src/flows/membership/updatingAccounts.ts

@@ -9,14 +9,21 @@ export default async function profileUpdate({ api, query }: FlowProps): Promise<
   debug('Started')
   api.enableDebugTxLogs()
 
-  const [account] = api.createKeyPairs(1).map((key) => key.address)
+  const [account] = (await api.createKeyPairs(1)).map((key) => key.address)
   const buyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture(api, query, [account])
   await new FixtureRunner(buyMembershipHappyCaseFixture).run()
   const [memberId] = buyMembershipHappyCaseFixture.getCreatedMembers()
-  const updateAccountsHappyCaseFixture = new UpdateAccountsHappyCaseFixture(api, query, {
-    account,
-    memberId,
-  })
+  const [newRootAccount, newControllerAccount] = (await api.createKeyPairs(2)).map((key) => key.address)
+  const updateAccountsHappyCaseFixture = new UpdateAccountsHappyCaseFixture(
+    api,
+    query,
+    {
+      account,
+      memberId,
+    },
+    newRootAccount,
+    newControllerAccount
+  )
   await new FixtureRunner(updateAccountsHappyCaseFixture).run()
 
   debug('Done')

+ 1 - 1
tests/integration-tests/src/flows/membership/updatingProfile.ts

@@ -9,7 +9,7 @@ export default async function profileUpdate({ api, query }: FlowProps): Promise<
   debug('Started')
   api.enableDebugTxLogs()
 
-  const [account] = api.createKeyPairs(1).map((key) => key.address)
+  const [account] = (await api.createKeyPairs(1)).map((key) => key.address)
   const buyMembershipHappyCaseFixture = new BuyMembershipHappyCaseFixture(api, query, [account])
   await new FixtureRunner(buyMembershipHappyCaseFixture).run()
   const [memberId] = buyMembershipHappyCaseFixture.getCreatedMembers()

+ 29 - 29
types/augment-codec/augment-api-query.ts

@@ -61,7 +61,7 @@ declare module '@polkadot/api/types/storage' {
       initialized: AugmentedQuery<ApiType, () => Observable<Option<MaybeRandomness>>>;
       /**
        * How late the current block is compared to its parent.
-       * 
+       *
        * This entry is populated as part of block execution and is cleaned up
        * on block finalization. Querying this storage entry outside of block
        * execution context should always yield zero.
@@ -77,9 +77,9 @@ declare module '@polkadot/api/types/storage' {
       nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
       /**
        * The epoch randomness for the *current* epoch.
-       * 
+       *
        * # Security
-       * 
+       *
        * This MUST NOT be used for gambling, as it can be influenced by a
        * malicious validator in the short term. It MAY be used in many
        * cryptographic protocols, however, so long as one remembers that this
@@ -90,11 +90,11 @@ declare module '@polkadot/api/types/storage' {
       randomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
       /**
        * Randomness under construction.
-       * 
+       *
        * We make a tradeoff between storage accesses and list length.
        * We store the under-construction randomness in segments of up to
        * `UNDER_CONSTRUCTION_SEGMENT_LENGTH`.
-       * 
+       *
        * Once a segment reaches this length, we begin the next one.
        * We reset all segments and return to `0` at the beginning of every
        * epoch.
@@ -108,7 +108,7 @@ declare module '@polkadot/api/types/storage' {
     balances: {
       /**
        * The balance of an account.
-       * 
+       *
        * NOTE: This is only used in the case that this module is used to store balances.
        **/
       account: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<AccountData>>;
@@ -119,7 +119,7 @@ declare module '@polkadot/api/types/storage' {
       locks: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Vec<BalanceLock>>>;
       /**
        * Storage version of the pallet.
-       * 
+       *
        * This is set to v2.0.0 for new networks.
        **/
       storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
@@ -431,7 +431,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * A mapping from grandpa set ID to the index of the *most recent* session for which its
        * members were responsible.
-       * 
+       *
        * TWOX-NOTE: `SetId` is not under user control.
        **/
       setIdSession: AugmentedQuery<ApiType, (arg: SetId | AnyNumber | Uint8Array) => Observable<Option<SessionIndex>>>;
@@ -452,7 +452,7 @@ declare module '@polkadot/api/types/storage' {
       authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>>;
       /**
        * The block number after which it's ok to send heartbeats in current session.
-       * 
+       *
        * At the beginning of each session we set this to a value that should
        * fall roughly in the middle of the session duration.
        * The idea is to first wait for the validators to produce a block
@@ -566,9 +566,9 @@ declare module '@polkadot/api/types/storage' {
       reports: AugmentedQuery<ApiType, (arg: ReportIdOf | string | Uint8Array) => Observable<Option<OffenceDetails>>>;
       /**
        * Enumerates all reports of a kind along with the time they happened.
-       * 
+       *
        * All reports are sorted by the time of offence.
-       * 
+       *
        * Note that the actual type of this mapping is `Vec<u8>`, this is because values of
        * different types are not supported at the moment so we are doing the manual serialization.
        **/
@@ -650,7 +650,7 @@ declare module '@polkadot/api/types/storage' {
       currentIndex: AugmentedQuery<ApiType, () => Observable<SessionIndex>>;
       /**
        * Indices of disabled validators.
-       * 
+       *
        * The set is cleared when `on_session_ending` returns a new set of identities.
        **/
       disabledValidators: AugmentedQuery<ApiType, () => Observable<Vec<u32>>>;
@@ -680,7 +680,7 @@ declare module '@polkadot/api/types/storage' {
     staking: {
       /**
        * The active era information, it holds index and start.
-       * 
+       *
        * The active era is the era currently rewarded.
        * Validator set of this era must be equal to `SessionInterface::validators`.
        **/
@@ -691,7 +691,7 @@ declare module '@polkadot/api/types/storage' {
       bonded: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<AccountId>>>;
       /**
        * A mapping from still-bonded eras to the first session index of that era.
-       * 
+       *
        * Must contains information for eras for the range:
        * `[active_era - bounding_duration; active_era]`
        **/
@@ -703,7 +703,7 @@ declare module '@polkadot/api/types/storage' {
       canceledSlashPayout: AugmentedQuery<ApiType, () => Observable<BalanceOf>>;
       /**
        * The current era index.
-       * 
+       *
        * This is the latest planned era, depending on how the Session pallet queues the validator
        * set, it might be active or not.
        **/
@@ -724,23 +724,23 @@ declare module '@polkadot/api/types/storage' {
       erasRewardPoints: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<EraRewardPoints>>;
       /**
        * Exposure of validator at era.
-       * 
+       *
        * This is keyed first by the era index to allow bulk deletion and then the stash account.
-       * 
+       *
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
       erasStakers: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>>;
       /**
        * Clipped Exposure of validator at era.
-       * 
+       *
        * This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the
        * `T::MaxNominatorRewardedPerValidator` biggest stakers.
        * (Note: the field `total` and `own` of the exposure remains unchanged).
        * This is used to limit the i/o cost for the nominator payout.
-       * 
+       *
        * This is keyed fist by the era index to allow bulk deletion and then the stash account.
-       * 
+       *
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
@@ -756,15 +756,15 @@ declare module '@polkadot/api/types/storage' {
       erasTotalStake: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<BalanceOf>>;
       /**
        * Similar to `ErasStakers`, this holds the preferences of validators.
-       * 
+       *
        * This is keyed first by the era index to allow bulk deletion and then the stash account.
-       * 
+       *
        * Is it removed after `HISTORY_DEPTH` eras.
        **/
       erasValidatorPrefs: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>>;
       /**
        * The total validator era payout for the last `HISTORY_DEPTH` eras.
-       * 
+       *
        * Eras that haven't finished yet or has been removed doesn't have reward.
        **/
       erasValidatorReward: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<Option<BalanceOf>>>;
@@ -774,9 +774,9 @@ declare module '@polkadot/api/types/storage' {
       forceEra: AugmentedQuery<ApiType, () => Observable<Forcing>>;
       /**
        * Number of eras to keep in history.
-       * 
+       *
        * Information is kept for eras in `[current_era - history_depth; current_era]`.
-       * 
+       *
        * Must be more than the number of eras delayed by session otherwise. I.e. active era must
        * always be in history. I.e. `active_era > current_era - history_depth` must be
        * guaranteed.
@@ -829,7 +829,7 @@ declare module '@polkadot/api/types/storage' {
       slashingSpans: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<SlashingSpans>>>;
       /**
        * The percentage of the slash that is distributed to reporters.
-       * 
+       *
        * The rest of the slashed value is handled by the `Slash`.
        **/
       slashRewardFraction: AugmentedQuery<ApiType, () => Observable<Perbill>>;
@@ -851,7 +851,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * True if network has been upgraded to this version.
        * Storage version of the pallet.
-       * 
+       *
        * This is set to v3.0.0 for new networks.
        **/
       storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
@@ -953,11 +953,11 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Mapping between a topic (represented by T::Hash) and a vector of indexes
        * of events in the `<Events<T>>` list.
-       * 
+       *
        * All topic vectors have deterministic storage locations depending on the topic. This
        * allows light-clients to leverage the changes trie storage tracking mechanism and
        * in case of changes fetch the list of events of interest.
-       * 
+       *
        * The value has the type `(T::BlockNumber, EventIndex)` because if we used only just
        * the `EventIndex` then in case if the topic has the same contents on the next block
        * no notification will be triggered thus the event might be lost.

File diff ditekan karena terlalu besar
+ 157 - 157
types/augment-codec/augment-api-tx.ts


+ 29 - 29
types/augment/augment-api-query.ts

@@ -61,7 +61,7 @@ declare module '@polkadot/api/types/storage' {
       initialized: AugmentedQuery<ApiType, () => Observable<Option<MaybeRandomness>>>;
       /**
        * How late the current block is compared to its parent.
-       * 
+       *
        * This entry is populated as part of block execution and is cleaned up
        * on block finalization. Querying this storage entry outside of block
        * execution context should always yield zero.
@@ -77,9 +77,9 @@ declare module '@polkadot/api/types/storage' {
       nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
       /**
        * The epoch randomness for the *current* epoch.
-       * 
+       *
        * # Security
-       * 
+       *
        * This MUST NOT be used for gambling, as it can be influenced by a
        * malicious validator in the short term. It MAY be used in many
        * cryptographic protocols, however, so long as one remembers that this
@@ -90,11 +90,11 @@ declare module '@polkadot/api/types/storage' {
       randomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
       /**
        * Randomness under construction.
-       * 
+       *
        * We make a tradeoff between storage accesses and list length.
        * We store the under-construction randomness in segments of up to
        * `UNDER_CONSTRUCTION_SEGMENT_LENGTH`.
-       * 
+       *
        * Once a segment reaches this length, we begin the next one.
        * We reset all segments and return to `0` at the beginning of every
        * epoch.
@@ -108,7 +108,7 @@ declare module '@polkadot/api/types/storage' {
     balances: {
       /**
        * The balance of an account.
-       * 
+       *
        * NOTE: This is only used in the case that this module is used to store balances.
        **/
       account: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<AccountData>>;
@@ -119,7 +119,7 @@ declare module '@polkadot/api/types/storage' {
       locks: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Vec<BalanceLock>>>;
       /**
        * Storage version of the pallet.
-       * 
+       *
        * This is set to v2.0.0 for new networks.
        **/
       storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
@@ -431,7 +431,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * A mapping from grandpa set ID to the index of the *most recent* session for which its
        * members were responsible.
-       * 
+       *
        * TWOX-NOTE: `SetId` is not under user control.
        **/
       setIdSession: AugmentedQuery<ApiType, (arg: SetId | AnyNumber | Uint8Array) => Observable<Option<SessionIndex>>>;
@@ -452,7 +452,7 @@ declare module '@polkadot/api/types/storage' {
       authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>>;
       /**
        * The block number after which it's ok to send heartbeats in current session.
-       * 
+       *
        * At the beginning of each session we set this to a value that should
        * fall roughly in the middle of the session duration.
        * The idea is to first wait for the validators to produce a block
@@ -566,9 +566,9 @@ declare module '@polkadot/api/types/storage' {
       reports: AugmentedQuery<ApiType, (arg: ReportIdOf | string | Uint8Array) => Observable<Option<OffenceDetails>>>;
       /**
        * Enumerates all reports of a kind along with the time they happened.
-       * 
+       *
        * All reports are sorted by the time of offence.
-       * 
+       *
        * Note that the actual type of this mapping is `Vec<u8>`, this is because values of
        * different types are not supported at the moment so we are doing the manual serialization.
        **/
@@ -650,7 +650,7 @@ declare module '@polkadot/api/types/storage' {
       currentIndex: AugmentedQuery<ApiType, () => Observable<SessionIndex>>;
       /**
        * Indices of disabled validators.
-       * 
+       *
        * The set is cleared when `on_session_ending` returns a new set of identities.
        **/
       disabledValidators: AugmentedQuery<ApiType, () => Observable<Vec<u32>>>;
@@ -680,7 +680,7 @@ declare module '@polkadot/api/types/storage' {
     staking: {
       /**
        * The active era information, it holds index and start.
-       * 
+       *
        * The active era is the era currently rewarded.
        * Validator set of this era must be equal to `SessionInterface::validators`.
        **/
@@ -691,7 +691,7 @@ declare module '@polkadot/api/types/storage' {
       bonded: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<AccountId>>>;
       /**
        * A mapping from still-bonded eras to the first session index of that era.
-       * 
+       *
        * Must contains information for eras for the range:
        * `[active_era - bounding_duration; active_era]`
        **/
@@ -703,7 +703,7 @@ declare module '@polkadot/api/types/storage' {
       canceledSlashPayout: AugmentedQuery<ApiType, () => Observable<BalanceOf>>;
       /**
        * The current era index.
-       * 
+       *
        * This is the latest planned era, depending on how the Session pallet queues the validator
        * set, it might be active or not.
        **/
@@ -724,23 +724,23 @@ declare module '@polkadot/api/types/storage' {
       erasRewardPoints: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<EraRewardPoints>>;
       /**
        * Exposure of validator at era.
-       * 
+       *
        * This is keyed first by the era index to allow bulk deletion and then the stash account.
-       * 
+       *
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
       erasStakers: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>>;
       /**
        * Clipped Exposure of validator at era.
-       * 
+       *
        * This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the
        * `T::MaxNominatorRewardedPerValidator` biggest stakers.
        * (Note: the field `total` and `own` of the exposure remains unchanged).
        * This is used to limit the i/o cost for the nominator payout.
-       * 
+       *
        * This is keyed fist by the era index to allow bulk deletion and then the stash account.
-       * 
+       *
        * Is it removed after `HISTORY_DEPTH` eras.
        * If stakers hasn't been set or has been removed then empty exposure is returned.
        **/
@@ -756,15 +756,15 @@ declare module '@polkadot/api/types/storage' {
       erasTotalStake: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<BalanceOf>>;
       /**
        * Similar to `ErasStakers`, this holds the preferences of validators.
-       * 
+       *
        * This is keyed first by the era index to allow bulk deletion and then the stash account.
-       * 
+       *
        * Is it removed after `HISTORY_DEPTH` eras.
        **/
       erasValidatorPrefs: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>>;
       /**
        * The total validator era payout for the last `HISTORY_DEPTH` eras.
-       * 
+       *
        * Eras that haven't finished yet or has been removed doesn't have reward.
        **/
       erasValidatorReward: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<Option<BalanceOf>>>;
@@ -774,9 +774,9 @@ declare module '@polkadot/api/types/storage' {
       forceEra: AugmentedQuery<ApiType, () => Observable<Forcing>>;
       /**
        * Number of eras to keep in history.
-       * 
+       *
        * Information is kept for eras in `[current_era - history_depth; current_era]`.
-       * 
+       *
        * Must be more than the number of eras delayed by session otherwise. I.e. active era must
        * always be in history. I.e. `active_era > current_era - history_depth` must be
        * guaranteed.
@@ -829,7 +829,7 @@ declare module '@polkadot/api/types/storage' {
       slashingSpans: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<SlashingSpans>>>;
       /**
        * The percentage of the slash that is distributed to reporters.
-       * 
+       *
        * The rest of the slashed value is handled by the `Slash`.
        **/
       slashRewardFraction: AugmentedQuery<ApiType, () => Observable<Perbill>>;
@@ -851,7 +851,7 @@ declare module '@polkadot/api/types/storage' {
       /**
        * True if network has been upgraded to this version.
        * Storage version of the pallet.
-       * 
+       *
        * This is set to v3.0.0 for new networks.
        **/
       storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
@@ -953,11 +953,11 @@ declare module '@polkadot/api/types/storage' {
       /**
        * Mapping between a topic (represented by T::Hash) and a vector of indexes
        * of events in the `<Events<T>>` list.
-       * 
+       *
        * All topic vectors have deterministic storage locations depending on the topic. This
        * allows light-clients to leverage the changes trie storage tracking mechanism and
        * in case of changes fetch the list of events of interest.
-       * 
+       *
        * The value has the type `(T::BlockNumber, EventIndex)` because if we used only just
        * the `EventIndex` then in case if the topic has the same contents on the next block
        * no notification will be triggered thus the event might be lost.

File diff ditekan karena terlalu besar
+ 157 - 157
types/augment/augment-api-tx.ts


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini