Skip to content

Commit

Permalink
Check validator data after validate extrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbmb committed Feb 6, 2025
1 parent 098e221 commit d89232d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/shared/src/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { check, checkEvents } from './helpers/index.js'

import { sendTransaction } from '@acala-network/chopsticks-testing'
import type { KeyringPair } from '@polkadot/keyring/types'
import type { PalletStakingValidatorPrefs } from '@polkadot/types/lookup'
import { assert, describe, test } from 'vitest'

/// -------
Expand Down Expand Up @@ -155,6 +156,12 @@ async function stakingLifecycleTest<
client.dev.newBlock()

await checkEvents(validateEvents, 'staking').toMatchSnapshot(`validator ${index} validate events`)

const prefs: PalletStakingValidatorPrefs = await client.api.query.staking.validators(validator.address)
const { commission, blocked } = prefs

assert(commission.eq(minValidatorCommission))
assert(blocked.isFalse)
}

///
Expand Down Expand Up @@ -276,6 +283,12 @@ async function stakingLifecycleTest<

await checkEvents(blockEvents, 'staking').toMatchSnapshot('validate (blocked) events')

const prefs: PalletStakingValidatorPrefs = await client.api.query.staking.validators(validators[0].address)
const { commission, blocked } = prefs

assert(commission.eq(minValidatorCommission))
assert(blocked.isTrue)

///
/// Nominator tries to select the blocked validator
///
Expand Down

0 comments on commit d89232d

Please sign in to comment.