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.2 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 operator 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. // Pending represents a valid L2Tx that hasn't started the forging process
  22. Pending PoolL2TxStatus = "Pending"
  23. // Forging represents a valid L2Tx that has started the forging process
  24. Forging PoolL2TxStatus = "Forging"
  25. // Forged represents a L2Tx that has already been forged
  26. Forged PoolL2TxStatus = "Forged"
  27. // Invalid represents a L2Tx that has been invalidated
  28. Invalid PoolL2TxStatus = "Invalid"
  29. )