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 coordinator 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 // PoolL2TxStatusPending represents a valid L2Tx that hasn't started the forging process
27 PoolL2TxStatusPending PoolL2TxStatus = "Pending"
28 // PoolL2TxStatusForging represents a valid L2Tx that has started the forging process
29 PoolL2TxStatusForging PoolL2TxStatus = "Forging"
30 // PoolL2TxStatusForged represents a L2Tx that has already been forged
31 PoolL2TxStatusForged PoolL2TxStatus = "Forged"
32 // PoolL2TxStatusInvalid represents a L2Tx that has been invalidated
33 PoolL2TxStatusInvalid PoolL2TxStatus = "Invalid"
34)