Skip to content
Closed
Changes from all commits
Commits
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
23 changes: 7 additions & 16 deletions packages/shared/src/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,7 @@
const preChillThreshold = (await client.api.query.staking.chillThreshold()).unwrapOr(tenPercent).toNumber()
const preMinCommission = (await client.api.query.staking.minCommission()).toNumber()
const preMaxStakedRewards = (await client.api.query.staking.maxStakedRewards()).unwrapOr(tenPercent).toNumber()

const isKusama = chain.networkGroup === 'kusama'
const preAreNominatorsSlashable = isKusama
? ((await client.api.query.staking.areNominatorsSlashable()).toPrimitive() as boolean)
: undefined
const preAreNominatorsSlashable = (await client.api.query.staking.areNominatorsSlashable()).toPrimitive() as boolean

Check failure on line 737 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > set staking configs

TypeError: client.api.query.staking.areNominatorsSlashable is not a function ❯ setStakingConfigsTest packages/shared/src/staking.ts:737:69 ❯ testFn packages/shared/src/staking.ts:2125:29

Check failure on line 737 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > set staking configs

TypeError: client.api.query.staking.areNominatorsSlashable is not a function ❯ setStakingConfigsTest packages/shared/src/staking.ts:737:69 ❯ testFn packages/shared/src/staking.ts:2125:29

Check failure on line 737 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > set staking configs

TypeError: client.api.query.staking.areNominatorsSlashable is not a function ❯ setStakingConfigsTest packages/shared/src/staking.ts:737:69 ❯ testFn packages/shared/src/staking.ts:2125:29

Check failure on line 737 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > set staking configs

TypeError: client.api.query.staking.areNominatorsSlashable is not a function ❯ setStakingConfigsTest packages/shared/src/staking.ts:737:69 ❯ testFn packages/shared/src/staking.ts:2125:29

const setStakingConfigsCall = (inc: number) => {
const args: any[] = [
Expand All @@ -749,8 +745,8 @@
{ Set: preChillThreshold + inc },
{ Set: preMinCommission + inc },
{ Set: preMaxStakedRewards + inc },
{ Set: !preAreNominatorsSlashable },
]
if (isKusama) args.push({ Set: !preAreNominatorsSlashable })
return (client.api.tx.staking.setStakingConfigs as any)(...args)
}

Expand Down Expand Up @@ -813,9 +809,7 @@
const postChillThreshold = (await client.api.query.staking.chillThreshold()).unwrap().toNumber()
const postMinCommission = (await client.api.query.staking.minCommission()).toNumber()
const postMaxStakedRewards = (await client.api.query.staking.maxStakedRewards()).unwrap().toNumber()
const postAreNominatorsSlashable = isKusama
? ((await client.api.query.staking.areNominatorsSlashable()).toPrimitive() as boolean)
: undefined
const postAreNominatorsSlashable = (await client.api.query.staking.areNominatorsSlashable()).toPrimitive() as boolean

const [setStakingConfigsSuccess] = events.filter((record) => {
const { event } = record
Expand All @@ -831,9 +825,7 @@
expect(postChillThreshold).toBe(preChillThreshold + inc)
expect(postMinCommission).toBe(preMinCommission + inc)
expect(postMaxStakedRewards).toBe(preMaxStakedRewards + inc)
if (isKusama) {
expect(postAreNominatorsSlashable).toBe(!preAreNominatorsSlashable)
}
expect(postAreNominatorsSlashable).toBe(!preAreNominatorsSlashable)
}

/**
Expand Down Expand Up @@ -907,9 +899,9 @@
{ Noop: null },
{ Set: newCommission },
{ Noop: null },
{ Noop: null },
]
if (chain.networkGroup === 'kusama') setStakingConfigsArgs.push({ Noop: null })
const setStakingConfigsTx = (client.api.tx.staking.setStakingConfigs as any)(...setStakingConfigsArgs)

Check failure on line 904 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > force apply validator commission

Error: Extrinsic staking.setStakingConfigs expects 7 arguments, got 8. ❯ extrinsicFn node_modules/@polkadot/types/metadata/decorate/extrinsics/createUnchecked.js:11:19 ❯ Object.setStakingConfigs node_modules/@polkadot/api/base/Decorate.js:541:50 ❯ forceApplyValidatorCommissionTest packages/shared/src/staking.ts:904:54 ❯ testFn packages/shared/src/staking.ts:2130:29

Check failure on line 904 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > force apply validator commission

Error: Extrinsic staking.setStakingConfigs expects 7 arguments, got 8. ❯ extrinsicFn node_modules/@polkadot/types/metadata/decorate/extrinsics/createUnchecked.js:11:19 ❯ Object.setStakingConfigs node_modules/@polkadot/api/base/Decorate.js:541:50 ❯ forceApplyValidatorCommissionTest packages/shared/src/staking.ts:904:54 ❯ testFn packages/shared/src/staking.ts:2130:29

Check failure on line 904 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > force apply validator commission

Error: Extrinsic staking.setStakingConfigs expects 7 arguments, got 8. ❯ extrinsicFn node_modules/@polkadot/types/metadata/decorate/extrinsics/createUnchecked.js:11:19 ❯ Object.setStakingConfigs node_modules/@polkadot/api/base/Decorate.js:541:50 ❯ forceApplyValidatorCommissionTest packages/shared/src/staking.ts:904:54 ❯ testFn packages/shared/src/staking.ts:2130:29

Check failure on line 904 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > force apply validator commission

Error: Extrinsic staking.setStakingConfigs expects 7 arguments, got 8. ❯ extrinsicFn node_modules/@polkadot/types/metadata/decorate/extrinsics/createUnchecked.js:11:19 ❯ Object.setStakingConfigs node_modules/@polkadot/api/base/Decorate.js:541:50 ❯ forceApplyValidatorCommissionTest packages/shared/src/staking.ts:904:54 ❯ testFn packages/shared/src/staking.ts:2130:29

await scheduleInlineCallWithOrigin(
client,
Expand Down Expand Up @@ -1104,9 +1096,9 @@
{ Remove: null },
{ Noop: null },
{ Noop: null },
{ Noop: null },
]
if (chain.networkGroup === 'kusama') chillConfigArgs.push({ Noop: null })
const setStakingConfigsCall = (client.api.tx.staking.setStakingConfigs as any)(...chillConfigArgs)

Check failure on line 1101 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > chill other

Error: Extrinsic staking.setStakingConfigs expects 7 arguments, got 8. ❯ extrinsicFn node_modules/@polkadot/types/metadata/decorate/extrinsics/createUnchecked.js:11:19 ❯ Object.setStakingConfigs node_modules/@polkadot/api/base/Decorate.js:541:50 ❯ chillOtherTest packages/shared/src/staking.ts:1101:56 ❯ testFn packages/shared/src/staking.ts:2140:29

Check failure on line 1101 in packages/shared/src/staking.ts

View workflow job for this annotation

GitHub Actions / Tests (polkadot)

packages/polkadot/src/assetHubPolkadot.staking.e2e.test.ts > Polkadot Asset Hub Staking > base staking tests > chill other

Error: Extrinsic staking.setStakingConfigs expects 7 arguments, got 8. ❯ extrinsicFn node_modules/@polkadot/types/metadata/decorate/extrinsics/createUnchecked.js:11:19 ❯ Object.setStakingConfigs node_modules/@polkadot/api/base/Decorate.js:541:50 ❯ chillOtherTest packages/shared/src/staking.ts:1101:56 ❯ testFn packages/shared/src/staking.ts:2140:29

await scheduleInlineCallWithOrigin(
client,
Expand Down Expand Up @@ -1186,8 +1178,7 @@
[setNominatorCount, setValidatorCount],
]) {
for (const chillThreshold of [remove, chillThresholdSet]) {
const trailingNoops = chain.networkGroup === 'kusama' ? 3 : 2
const args = [...bondLimits, ...countLimits, chillThreshold, ...Array(trailingNoops).fill(noop)]
const args = [...bondLimits, ...countLimits, chillThreshold, ...Array(3).fill(noop)]

setStakingConfigsCalls.push((client.api.tx.staking.setStakingConfigs as any)(...args))
}
Expand Down
Loading