mirror of
https://github.com/grassrootseconomics/eth-tracker.git
synced 2026-05-15 17:57:11 +02:00
feat: add within network check for approve events
This commit is contained in:
@@ -30,7 +30,7 @@ func HandleTokenTransferLog(hc *HandlerContainer) router.LogHandlerFunc {
|
||||
return err
|
||||
}
|
||||
|
||||
proceed, err := hc.checkTransferWithinNetwork(ctx, lp.Log.Address.Hex(), from.Hex(), to.Hex())
|
||||
proceed, err := hc.checkWithinNetwork(ctx, lp.Log.Address.Hex(), from.Hex(), to.Hex())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -79,7 +79,7 @@ func HandleTokenTransferInputData(hc *HandlerContainer) router.InputDataHandlerF
|
||||
return err
|
||||
}
|
||||
|
||||
proceed, err := hc.checkTransferWithinNetwork(ctx, idp.ContractAddress, idp.From, to.Hex())
|
||||
proceed, err := hc.checkWithinNetwork(ctx, idp.ContractAddress, idp.From, to.Hex())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -105,7 +105,7 @@ func HandleTokenTransferInputData(hc *HandlerContainer) router.InputDataHandlerF
|
||||
return err
|
||||
}
|
||||
|
||||
proceed, err := hc.checkTransferWithinNetwork(ctx, idp.ContractAddress, from.Hex(), to.Hex())
|
||||
proceed, err := hc.checkWithinNetwork(ctx, idp.ContractAddress, from.Hex(), to.Hex())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -125,12 +125,3 @@ func HandleTokenTransferInputData(hc *HandlerContainer) router.InputDataHandlerF
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (hc *HandlerContainer) checkTransferWithinNetwork(ctx context.Context, contractAddress string, from string, to string) (bool, error) {
|
||||
exists, err := hc.cache.ExistsNetwork(ctx, contractAddress, from, to)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return exists, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user