You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2 KiB

  1. package common
  2. import (
  3. "errors"
  4. "github.com/hermeznetwork/tracerr"
  5. )
  6. // ErrNotInFF is used when the *big.Int does not fit inside the Finite Field
  7. var ErrNotInFF = errors.New("BigInt not inside the Finite Field")
  8. // ErrNumOverflow is used when a given value overflows the maximum capacity of the parameter
  9. var ErrNumOverflow = errors.New("Value overflows the type")
  10. // ErrNonceOverflow is used when a given nonce overflows the maximum capacity of the Nonce (2**40-1)
  11. var ErrNonceOverflow = errors.New("Nonce overflow, max value: 2**40 -1")
  12. // ErrIdxOverflow is used when a given nonce overflows the maximum capacity of the Idx (2**48-1)
  13. var ErrIdxOverflow = errors.New("Idx overflow, max value: 2**48 -1")
  14. // ErrBatchQueueEmpty is used when the coordinator.BatchQueue.Pop() is called and has no elements
  15. var ErrBatchQueueEmpty = errors.New("BatchQueue empty")
  16. // ErrTODO is used when a function is not yet implemented
  17. var ErrTODO = errors.New("TODO")
  18. // ErrDone is used when a function returns earlier due to a cancelled context
  19. var ErrDone = errors.New("done")
  20. // IsErrDone returns true if the error or wrapped (with tracerr) error is ErrDone
  21. func IsErrDone(err error) bool {
  22. return tracerr.Unwrap(err) == ErrDone
  23. }