Merge branch 'master' into cel2

This commit is contained in:
Mohamed Sohail 2025-07-03 11:52:43 +03:00
commit b8870532d1
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
2 changed files with 6 additions and 2 deletions

View File

@ -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))

View File

@ -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)
} }
} }