Add Coordinator goroutines & channels processes

Add Coordinator goroutines & channels processes
- Add Coordinator goroutines & channels
- Add Coordinator test to debug batches
- Add MakeCheckpoint call after BatchBuilder BuildBatch process
- Update ethClient BlockByNumber to return hermez/common.Block instead of go-ethereum/core/types.Block
This commit is contained in:
arnaucube
2020-08-26 18:32:03 +02:00
parent 9309722dfc
commit 26dbb16618
8 changed files with 257 additions and 72 deletions

View File

@@ -195,9 +195,18 @@ func (c *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.He
return c.client.HeaderByNumber(ctx, number)
}
// BlockByNumber internally calls ethclient.Client BlockByNumber
func (c *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) {
return c.client.BlockByNumber(ctx, number)
// BlockByNumber internally calls ethclient.Client BlockByNumber and returns *common.Block
func (c *Client) BlockByNumber(ctx context.Context, number *big.Int) (*common.Block, error) {
block, err := c.client.BlockByNumber(ctx, number)
if err != nil {
return nil, err
}
b := &common.Block{
EthBlockNum: block.Number().Uint64(),
Timestamp: time.Unix(int64(block.Time()), 0),
Hash: block.Hash(),
}
return b, nil
}
func (c *Client) ForgeCall(callData *common.CallDataForge) ([]byte, error) {