Add ethclient full skeleton

This commit is contained in:
Eduard S
2020-09-03 13:04:36 +02:00
parent 7701af194f
commit 003c353f05
11 changed files with 1237 additions and 276 deletions

View File

@@ -255,8 +255,8 @@ func (c *Coordinator) proveSequence() error {
return err
}
batchInfo.SetProof(proof)
callData := c.prepareCallDataForge(batchInfo)
_, err = c.ethClient.ForgeCall(callData)
forgeBatchArgs := c.prepareForgeBatchArgs(batchInfo)
_, err = c.ethClient.RollupForgeBatch(forgeBatchArgs)
if err != nil {
return err
}
@@ -306,6 +306,6 @@ func (c *Coordinator) shouldL1L2Batch() bool {
return false
}
func (c *Coordinator) prepareCallDataForge(batchInfo *BatchInfo) *common.CallDataForge {
func (c *Coordinator) prepareForgeBatchArgs(batchInfo *BatchInfo) *eth.RollupForgeBatchArgs {
return nil
}

View File

@@ -10,6 +10,7 @@ import (
"github.com/hermeznetwork/hermez-node/db/historydb"
"github.com/hermeznetwork/hermez-node/db/l2db"
"github.com/hermeznetwork/hermez-node/db/statedb"
"github.com/hermeznetwork/hermez-node/eth"
"github.com/hermeznetwork/hermez-node/log"
"github.com/hermeznetwork/hermez-node/txselector"
"github.com/stretchr/testify/assert"
@@ -50,7 +51,7 @@ func TestCoordinator(t *testing.T) {
LoopInterval: 100 * time.Millisecond,
}
hdb := &historydb.HistoryDB{}
c := NewCoordinator(conf, hdb, txsel, bb, nil)
c := NewCoordinator(conf, hdb, txsel, bb, &eth.Client{})
c.Start()
time.Sleep(1 * time.Second)