ForgeL1TxsNum*int64`meddler:"forge_l1_txs_num"`// optional, Only when the batch forges L1 txs. Identifier that corresponds to the group of L1 txs forged in the current batch.
ForgeL1TxsNum*int64`meddler:"forge_l1_txs_num"`// optional, Only when the batch forges L1 txs. Identifier that corresponds to the group of L1 txs forged in the current batch.
SlotNumSlotNum`meddler:"slot_num"`// Slot in which the batch is forged
SlotNumSlotNum`meddler:"slot_num"`// Slot in which the batch is forged
ToForgeL1TxsNum*int64// toForgeL1TxsNum in which the tx was forged / will be forged
ToForgeL1TxsNum*int64// toForgeL1TxsNum in which the tx was forged / will be forged
Positionint
Positionint
UserOriginbool// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
UserOriginbool// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
FromIdx*Idx// FromIdx is used by L1Tx/Deposit to indicate the Idx receiver of the L1Tx.LoadAmount (deposit)
FromIdxIdx// FromIdx is used by L1Tx/Deposit to indicate the Idx receiver of the L1Tx.LoadAmount (deposit)
FromEthAddrethCommon.Address
FromEthAddrethCommon.Address
FromBJJ*babyjub.PublicKey
FromBJJ*babyjub.PublicKey
ToIdxIdx// ToIdx is ignored in L1Tx/Deposit, but used in the L1Tx/DepositAndTransfer
ToIdxIdx// ToIdx is ignored in L1Tx/Deposit, but used in the L1Tx/DepositAndTransfer
@ -41,8 +41,6 @@ type L1Tx struct {
EthBlockNumint64// Ethereum Block Number in which this L1Tx was added to the queue
EthBlockNumint64// Ethereum Block Number in which this L1Tx was added to the queue
TypeTxType
TypeTxType
BatchNum*BatchNum
BatchNum*BatchNum
USD*float64
LoadAmountUSD*float64
}
}
// NewL1Tx returns the given L1Tx with the TxId & Type parameters calculated
// NewL1Tx returns the given L1Tx with the TxId & Type parameters calculated
// Tx is a struct used by the TxSelector & BatchBuilder as a generic type generated from L1Tx & PoolL2Tx
// Tx is a struct used by the TxSelector & BatchBuilder as a generic type generated from L1Tx & PoolL2Tx
// TODO: this should be changed for "mini Tx"
typeTxstruct{
typeTxstruct{
// Generic
// Generic
IsL1bool`meddler:"is_l1"`
IsL1bool`meddler:"is_l1"`
TxIDTxID`meddler:"id"`
TxIDTxID`meddler:"id"`
TypeTxType`meddler:"type"`
TypeTxType`meddler:"type"`
Positionint`meddler:"position"`
Positionint`meddler:"position"`
FromIdx*Idx`meddler:"from_idx"`
ToIdx*Idx`meddler:"to_idx"`
FromIdxIdx`meddler:"from_idx"`
ToIdxIdx`meddler:"to_idx"`
Amount*big.Int`meddler:"amount,bigint"`
Amount*big.Int`meddler:"amount,bigint"`
AmountFloatfloat64`meddler:"amount_f"`
AmountFloatfloat64`meddler:"amount_f"`
TokenIDTokenID`meddler:"token_id"`
TokenIDTokenID`meddler:"token_id"`
@ -101,7 +101,7 @@ type Tx struct {
// L1
// L1
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
BatchNum*common.BatchNum`meddler:"batch_num"`// batchNum in which this tx was forged. If the tx is L2, this must be != 0
BatchNum*common.BatchNum`meddler:"batch_num"`// batchNum in which this tx was forged. If the tx is L2, this must be != 0
EthBlockNumint64`meddler:"eth_block_num"`// Ethereum Block Number in which this L1Tx was added to the queue
EthBlockNumint64`meddler:"eth_block_num"`// Ethereum Block Number in which this L1Tx was added to the queue
// L1
// L1
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
// txWrite is an representatiion that merges common.L1Tx and common.L2Tx
// in order to perform inserts into tx table
typetxWritestruct{
// Generic
IsL1bool`meddler:"is_l1"`
TxIDcommon.TxID`meddler:"id"`
Typecommon.TxType`meddler:"type"`
Positionint`meddler:"position"`
FromIdx*common.Idx`meddler:"from_idx"`
ToIdxcommon.Idx`meddler:"to_idx"`
Amount*big.Int`meddler:"amount,bigint"`
AmountFloatfloat64`meddler:"amount_f"`
TokenIDcommon.TokenID`meddler:"token_id"`
BatchNum*common.BatchNum`meddler:"batch_num"`// batchNum in which this tx was forged. If the tx is L2, this must be != 0
EthBlockNumint64`meddler:"eth_block_num"`// Ethereum Block Number in which this L1Tx was added to the queue
// L1
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes