thehubbleproject / hubble-contracts

Hubble optimistic rollup
https://thehubbleproject.github.io/docs/
MIT License
133 stars 28 forks source link

Bug: Error: Bad nonce tx 0 state 0 #629

Closed jacque006 closed 3 years ago

jacque006 commented 3 years ago

Problem

     Error: Bad nonce  tx 0  state 0
      at validateTransferStateTransition (ts/client/features/transfer.ts:307:15)
      at pack (ts/client/features/transfer.ts:381:13)
      at packBatch (ts/client/features/transfer.ts:646:52)
      at TransferPackingCommand.packAndSubmit (ts/client/features/transfer.ts:691:51)
      at Packer.maybePackTransfers (ts/client/services/packer.ts:73:24)
      at Packer.runOnce (ts/client/services/packer.ts:90:9)
      at Context.<anonymous> (test/client/integration.test.ts:143:9)

Triage

Regression of https://github.com/thehubbleproject/hubble-contracts/pull/621

https://github.com/thehubbleproject/hubble-contracts/blob/master/ts/client/features/transfer.ts#L305

Cannot use equality comparison (==, !=, ===,!==`) with BigNumbers as they are objects.

Solution

Use eq with BigNumber for equality checks.