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