mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-08 03:46:52 +01:00
Add reverts, forge in test ethClient, update auction
This commit is contained in:
@@ -11,7 +11,7 @@ type Proof struct {
|
||||
// BatchInfo contans the Batch information
|
||||
type BatchInfo struct {
|
||||
batchNum common.BatchNum
|
||||
serverProof *ServerProofInfo
|
||||
serverProof ServerProofInterface
|
||||
zkInputs *common.ZKInputs
|
||||
proof *Proof
|
||||
L1UserTxsExtra []*common.L1Tx
|
||||
@@ -21,8 +21,8 @@ type BatchInfo struct {
|
||||
}
|
||||
|
||||
// NewBatchInfo creates a new BatchInfo with the given batchNum &
|
||||
// ServerProofInfo
|
||||
func NewBatchInfo(batchNum common.BatchNum, serverProof *ServerProofInfo) BatchInfo {
|
||||
// ServerProof
|
||||
func NewBatchInfo(batchNum common.BatchNum, serverProof ServerProofInterface) BatchInfo {
|
||||
return BatchInfo{
|
||||
batchNum: batchNum,
|
||||
serverProof: serverProof,
|
||||
@@ -43,8 +43,8 @@ func (bi *BatchInfo) SetZKInputs(zkInputs *common.ZKInputs) {
|
||||
bi.zkInputs = zkInputs
|
||||
}
|
||||
|
||||
// SetServerProof sets the ServerProofInfo to the BatchInfo data structure
|
||||
func (bi *BatchInfo) SetServerProof(serverProof *ServerProofInfo) {
|
||||
// SetServerProof sets the ServerProof to the BatchInfo data structure
|
||||
func (bi *BatchInfo) SetServerProof(serverProof ServerProofInterface) {
|
||||
bi.serverProof = serverProof
|
||||
}
|
||||
|
||||
@@ -53,29 +53,29 @@ func (bi *BatchInfo) SetProof(proof *Proof) {
|
||||
bi.proof = proof
|
||||
}
|
||||
|
||||
// BatchQueue implements a FIFO queue of BatchInfo
|
||||
type BatchQueue struct {
|
||||
queue []*BatchInfo
|
||||
}
|
||||
|
||||
// NewBatchQueue returns a new *BatchQueue
|
||||
func NewBatchQueue() *BatchQueue {
|
||||
return &BatchQueue{
|
||||
queue: []*BatchInfo{},
|
||||
}
|
||||
}
|
||||
|
||||
// Push adds the given BatchInfo to the BatchQueue
|
||||
func (bq *BatchQueue) Push(b *BatchInfo) {
|
||||
bq.queue = append(bq.queue, b)
|
||||
}
|
||||
|
||||
// Pop pops the first BatchInfo from the BatchQueue
|
||||
func (bq *BatchQueue) Pop() *BatchInfo {
|
||||
if len(bq.queue) == 0 {
|
||||
return nil
|
||||
}
|
||||
b := bq.queue[0]
|
||||
bq.queue = bq.queue[1:]
|
||||
return b
|
||||
}
|
||||
// // BatchQueue implements a FIFO queue of BatchInfo
|
||||
// type BatchQueue struct {
|
||||
// queue []*BatchInfo
|
||||
// }
|
||||
//
|
||||
// // NewBatchQueue returns a new *BatchQueue
|
||||
// func NewBatchQueue() *BatchQueue {
|
||||
// return &BatchQueue{
|
||||
// queue: []*BatchInfo{},
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Push adds the given BatchInfo to the BatchQueue
|
||||
// func (bq *BatchQueue) Push(b *BatchInfo) {
|
||||
// bq.queue = append(bq.queue, b)
|
||||
// }
|
||||
//
|
||||
// // Pop pops the first BatchInfo from the BatchQueue
|
||||
// func (bq *BatchQueue) Pop() *BatchInfo {
|
||||
// if len(bq.queue) == 0 {
|
||||
// return nil
|
||||
// }
|
||||
// b := bq.queue[0]
|
||||
// bq.queue = bq.queue[1:]
|
||||
// return b
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user