mirror of
https://github.com/grassrootseconomics/eth-tracker.git
synced 2025-07-04 13:42:49 +02:00
Merge branch 'master' into cel2
This commit is contained in:
commit
b8870532d1
@ -11,7 +11,7 @@ func bootstrapEventRouter(cacheProvider cache.Cache, pubCB router.Callback) *rou
|
|||||||
handlerContainer := handler.New(cacheProvider)
|
handlerContainer := handler.New(cacheProvider)
|
||||||
router := router.New(pubCB)
|
router := router.New(pubCB)
|
||||||
|
|
||||||
router.RegisterContractCreationHandler(handler.HandleContractCreation())
|
router.RegisterContractCreationHandler(handler.HandleContractCreation(handlerContainer))
|
||||||
|
|
||||||
router.RegisterLogRoute(w3.H("0x26162814817e23ec5035d6a2edc6c422da2da2119e27cfca6be65cc2dc55ca4c"), handler.HandleFaucetGiveLog())
|
router.RegisterLogRoute(w3.H("0x26162814817e23ec5035d6a2edc6c422da2da2119e27cfca6be65cc2dc55ca4c"), handler.HandleFaucetGiveLog())
|
||||||
router.RegisterLogRoute(w3.H("0xa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f"), handler.HandleIndexAddLog(handlerContainer))
|
router.RegisterLogRoute(w3.H("0xa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f"), handler.HandleIndexAddLog(handlerContainer))
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
const contractCreationEventName = "CONTRACT_CREATION"
|
const contractCreationEventName = "CONTRACT_CREATION"
|
||||||
|
|
||||||
func HandleContractCreation() router.ContractCreationHandlerFunc {
|
func HandleContractCreation(hc *HandlerContainer) router.ContractCreationHandlerFunc {
|
||||||
return func(ctx context.Context, ccp router.ContractCreationPayload, c router.Callback) error {
|
return func(ctx context.Context, ccp router.ContractCreationPayload, c router.Callback) error {
|
||||||
contractCreationEvent := event.Event{
|
contractCreationEvent := event.Event{
|
||||||
Block: ccp.Block,
|
Block: ccp.Block,
|
||||||
@ -23,6 +23,10 @@ func HandleContractCreation() router.ContractCreationHandlerFunc {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := hc.cache.Add(ctx, ccp.ContractAddress); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return c(ctx, contractCreationEvent)
|
return c(ctx, contractCreationEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user