mirror of
https://github.com/grassrootseconomics/eth-tracker.git
synced 2025-04-19 15:11:00 +02:00
55 lines
1.0 KiB
Go
55 lines
1.0 KiB
Go
package handler
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/celo-org/celo-blockchain/core/types"
|
|
"github.com/grassrootseconomics/celo-tracker/internal/cache"
|
|
"github.com/grassrootseconomics/celo-tracker/internal/pub"
|
|
)
|
|
|
|
type (
|
|
Handler interface {
|
|
Name() string
|
|
HandleLog(context.Context, LogMessage, pub.Pub) error
|
|
HandleRevert(context.Context, RevertMessage, pub.Pub) error
|
|
}
|
|
|
|
HandlerPipeline []Handler
|
|
|
|
LogMessage struct {
|
|
Log *types.Log
|
|
Timestamp uint64
|
|
}
|
|
|
|
RevertMessage struct {
|
|
From string
|
|
RevertReason string
|
|
InputData string
|
|
Block uint64
|
|
ContractAddress string
|
|
Timestamp uint64
|
|
TxHash string
|
|
}
|
|
)
|
|
|
|
func New(cache cache.Cache) HandlerPipeline {
|
|
return []Handler{
|
|
&TokenTransferHandler{},
|
|
&PoolSwapHandler{},
|
|
&FaucetGiveHandler{},
|
|
&PoolDepositHandler{},
|
|
&TokenMintHandler{},
|
|
&TokenBurnHandler{},
|
|
&QuoterPriceHandler{},
|
|
&OwnershipHandler{},
|
|
&SealHandler{},
|
|
&IndexAddHandler{
|
|
cache: cache,
|
|
},
|
|
&IndexRemoveHandler{
|
|
cache: cache,
|
|
},
|
|
}
|
|
}
|