Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chrlschwb committed Sep 8, 2023
1 parent dda8d15 commit b9a6763
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions tests/network-tests/src/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ export class ApiFactory {

constructor(api: ApiPromise, treasuryAccountUri: string, miniSecret: string) {
this.api = api
this.keyring = new Keyring({
type: 'sr25519',
ss58Format: JOYSTREAM_ADDRESS_PREFIX,
})
this.keyring = new Keyring({ type: 'sr25519', ss58Format: JOYSTREAM_ADDRESS_PREFIX })
this.treasuryAccount = this.keyring.addFromUri(treasuryAccountUri).address
this.miniSecret = miniSecret
this.addressesToKeyId = new Map()
Expand Down Expand Up @@ -430,13 +427,7 @@ export class Api {

public treasuryTransferBalanceToAccounts(destinations: string[], amount: BN): Promise<ISubmittableResult[]> {
return Promise.all(
destinations.map((account) =>
this.transferBalance({
from: this.treasuryAccount,
to: account,
amount,
})
)
destinations.map((account) => this.transferBalance({ from: this.treasuryAccount, to: account, amount }))
)
}

Expand Down Expand Up @@ -699,10 +690,10 @@ export class Api {
const { announcingPeriodDuration, idlePeriodDuration } = this.consts.council
const { voteStageDuration, revealStageDuration } = this.consts.referendum
const durationByStage = {
Announcing: announcingPeriodDuration,
Voting: voteStageDuration,
Revealing: revealStageDuration,
Idle: idlePeriodDuration,
'Announcing': announcingPeriodDuration,
'Voting': voteStageDuration,
'Revealing': revealStageDuration,
'Idle': idlePeriodDuration,
} as const

const currentStageEndsIn = currentStageStartedAt.add(durationByStage[currentStage]).sub(currentBlock)
Expand Down Expand Up @@ -944,9 +935,7 @@ export class Api {
) {
return this.sender.signAndSend(
this.api.tx.storage.updateStorageBucketsForBag(
createType('PalletStorageBagIdType', {
Dynamic: { Channel: Number(channelId) },
}),
createType('PalletStorageBagIdType', { Dynamic: { Channel: Number(channelId) } }),
createType(
'BTreeSet<u64>',
addStorageBuckets.map((item) => item)
Expand Down

0 comments on commit b9a6763

Please sign in to comment.