mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Add Sync stats, and report them in DebugAPI
This commit is contained in:
@@ -172,6 +172,7 @@ type RollupInterface interface {
|
||||
|
||||
// Viewers
|
||||
RollupRegisterTokensCount() (*big.Int, error)
|
||||
RollupLastForgedBatch() (int64, error)
|
||||
|
||||
//
|
||||
// Smart Contract Status
|
||||
@@ -400,14 +401,9 @@ func (c *RollupClient) RollupL1UserTxERC20Permit(fromBJJ *babyjub.PublicKey, fro
|
||||
}
|
||||
|
||||
// RollupRegisterTokensCount is the interface to call the smart contract function
|
||||
func (c *RollupClient) RollupRegisterTokensCount() (*big.Int, error) {
|
||||
var registerTokensCount *big.Int
|
||||
func (c *RollupClient) RollupRegisterTokensCount() (registerTokensCount *big.Int, err error) {
|
||||
if err := c.client.Call(func(ec *ethclient.Client) error {
|
||||
hermez, err := Hermez.NewHermez(c.address, ec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
registerTokensCount, err = hermez.RegisterTokensCount(nil)
|
||||
registerTokensCount, err = c.hermez.RegisterTokensCount(nil)
|
||||
return err
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
@@ -415,6 +411,18 @@ func (c *RollupClient) RollupRegisterTokensCount() (*big.Int, error) {
|
||||
return registerTokensCount, nil
|
||||
}
|
||||
|
||||
// RollupLastForgedBatch is the interface to call the smart contract function
|
||||
func (c *RollupClient) RollupLastForgedBatch() (lastForgedBatch int64, err error) {
|
||||
if err := c.client.Call(func(ec *ethclient.Client) error {
|
||||
_lastForgedBatch, err := c.hermez.LastForgedBatch(nil)
|
||||
lastForgedBatch = int64(_lastForgedBatch)
|
||||
return err
|
||||
}); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return lastForgedBatch, nil
|
||||
}
|
||||
|
||||
// RollupUpdateForgeL1L2BatchTimeout is the interface to call the smart contract function
|
||||
func (c *RollupClient) RollupUpdateForgeL1L2BatchTimeout(newForgeL1L2BatchTimeout int64) (tx *types.Transaction, err error) {
|
||||
if tx, err = c.client.CallAuth(
|
||||
|
||||
Reference in New Issue
Block a user