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.

34 lines
1.3 KiB

  1. package common
  2. import (
  3. "time"
  4. eth "github.com/ethereum/go-ethereum/common"
  5. "github.com/iden3/go-iden3-crypto/babyjub"
  6. )
  7. // PoolL2Tx is a struct that represents a L2Tx sent by an account to the coordinator hat is waiting to be forged
  8. type PoolL2Tx struct {
  9. Tx
  10. Status PoolL2TxStatus
  11. RqTxCompressedData []byte // 253 bits, optional for atomic txs
  12. RqToEthAddr eth.Address // optional for atomic txs
  13. RqToBjj babyjub.PublicKey // optional for atomic txs
  14. RqFromeEthAddr eth.Address // optional for atomic txs
  15. Received time.Time // time when added to the tx pool
  16. Signature babyjub.Signature // tx signature
  17. }
  18. // PoolL2TxStatus is a struct that represents the status of a L2 transaction
  19. type PoolL2TxStatus string
  20. const (
  21. // PoolL2TxStatusPending represents a valid L2Tx that hasn't started the forging process
  22. PoolL2TxStatusPending PoolL2TxStatus = "Pending"
  23. // PoolL2TxStatusForging represents a valid L2Tx that has started the forging process
  24. PoolL2TxStatusForging PoolL2TxStatus = "Forging"
  25. // PoolL2TxStatusForged represents a L2Tx that has already been forged
  26. PoolL2TxStatusForged PoolL2TxStatus = "Forged"
  27. // PoolL2TxStatusInvalid represents a L2Tx that has been invalidated
  28. PoolL2TxStatusInvalid PoolL2TxStatus = "Invalid"
  29. )