Skip to content

Commit be6fa17

Browse files
cducrestberndbohmeier
authored andcommitted
Add test for getting detailed error message for invalid nonce
1 parent 317e60b commit be6fa17

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/e2e/Identity.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,30 @@ describe('e2e', () => {
255255
expect(metaTransactionFees.baseFee).to.equal('1')
256256
})
257257
})
258+
259+
describe('Error messages', () => {
260+
before(async () => {
261+
const walletData = await identityWallet.create()
262+
await identityWallet.loadFrom(walletData)
263+
await identityWallet.deployIdentity()
264+
})
265+
266+
it('should get a detailed error message for invalid nonce', async () => {
267+
const rawTx: RawTxObject = {
268+
data: '0x',
269+
from: identityWallet.address,
270+
nonce: 123456,
271+
to: identityWallet.address,
272+
value: 0
273+
}
274+
try {
275+
await identityWallet.getMetaTxFees(rawTx)
276+
} catch (error) {
277+
expect(error.message).to.contain(
278+
'Invalid (nonce, hash) pair for meta-tx'
279+
)
280+
}
281+
})
282+
})
258283
})
259284
})

0 commit comments

Comments
 (0)