Skip to content

Commit d9fd351

Browse files
committed
switchPair error
1 parent 9b285ca commit d9fd351

File tree

1 file changed

+7
-7
lines changed
  • integration-tests/chopsticks/src/tests/switchPallet/pause/switchKilts

1 file changed

+7
-7
lines changed

integration-tests/chopsticks/src/tests/switchPallet/pause/switchKilts/index.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@ describe.each(testCases)('Switch KILTs while paused', ({ account, txContext, con
2727

2828
it(desc, async ({ expect }) => {
2929
const { balanceToTransfer, tx } = txContext
30-
let section: string = ''
31-
let errorName: string = ''
30+
let error
3231

3332
// This should fail.
3433
await tx(senderContext, hexAddress(senderAccount.address), balanceToTransfer.toString()).signAndSend(
3534
senderAccount,
3635
({ dispatchError }) => {
3736
if (dispatchError) {
38-
const decoded = senderContext.api.registry.findMetaError(dispatchError.asModule)
39-
section = decoded.section
40-
errorName = decoded.name
37+
error = dispatchError
4138
}
4239
}
4340
)
4441

4542
await createBlock(senderContext)
4643

47-
expect(section).toBe('assetSwitchPool1')
48-
expect(errorName).toBe('SwitchPairNotEnabled')
44+
if (!error) {
45+
throw new Error('Expected SwitchPairNotEnabled error')
46+
}
47+
48+
expect(senderContext.api.errors.assetSwitchPool1.SwitchPairNotEnabled.is(error))
4949
})
5050
})

0 commit comments

Comments
 (0)