Skip to content

Commit

Permalink
switchPair error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ad96el committed Feb 17, 2025
1 parent 9b285ca commit d9fd351
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ describe.each(testCases)('Switch KILTs while paused', ({ account, txContext, con

it(desc, async ({ expect }) => {
const { balanceToTransfer, tx } = txContext
let section: string = ''
let errorName: string = ''
let error

// This should fail.
await tx(senderContext, hexAddress(senderAccount.address), balanceToTransfer.toString()).signAndSend(
senderAccount,
({ dispatchError }) => {
if (dispatchError) {
const decoded = senderContext.api.registry.findMetaError(dispatchError.asModule)
section = decoded.section
errorName = decoded.name
error = dispatchError
}
}
)

await createBlock(senderContext)

expect(section).toBe('assetSwitchPool1')
expect(errorName).toBe('SwitchPairNotEnabled')
if (!error) {
throw new Error('Expected SwitchPairNotEnabled error')
}

expect(senderContext.api.errors.assetSwitchPool1.SwitchPairNotEnabled.is(error))
})
})

0 comments on commit d9fd351

Please sign in to comment.