Add forge delay to api get state

This commit is contained in:
arnaubennassar
2021-02-26 11:40:09 +01:00
parent 0adcf1a2bc
commit 54508b0ba6
5 changed files with 41 additions and 2 deletions

View File

@@ -392,6 +392,7 @@ func NewNode(mode Mode, cfg *config.Node) (*Node, error) {
ChainID: chainIDU16,
HermezAddress: cfg.SmartContracts.Rollup,
},
cfg.Coordinator.ForgeDelay.Duration,
)
if err != nil {
return nil, tracerr.Wrap(err)
@@ -447,6 +448,7 @@ func NewNodeAPI(
sdb *statedb.StateDB,
l2db *l2db.L2DB,
config *api.Config,
forgeDelay time.Duration,
) (*NodeAPI, error) {
engine := gin.Default()
engine.NoRoute(handleNoRoute)
@@ -457,6 +459,9 @@ func NewNodeAPI(
hdb,
l2db,
config,
&api.NodeConfig{
ForgeDelay: forgeDelay.Seconds(),
},
)
if err != nil {
return nil, tracerr.Wrap(err)