mirror of
https://github.com/grassrootseconomics/eth-tracker.git
synced 2025-07-06 14:22:48 +02:00
Merge branch 'master' into cel2
This commit is contained in:
commit
dd663ba921
19
internal/cache/bootstrap.go
vendored
19
internal/cache/bootstrap.go
vendored
@ -24,6 +24,7 @@ func bootstrapCache(
|
|||||||
var (
|
var (
|
||||||
tokenRegistryGetter = w3.MustNewFunc("tokenRegistry()", "address")
|
tokenRegistryGetter = w3.MustNewFunc("tokenRegistry()", "address")
|
||||||
quoterGetter = w3.MustNewFunc("quoter()", "address")
|
quoterGetter = w3.MustNewFunc("quoter()", "address")
|
||||||
|
systemAcccountGetter = w3.MustNewFunc("systemAccount()", "address")
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)
|
||||||
@ -46,6 +47,23 @@ func bootstrapCache(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if custodialRegistrationProxy := registryMap[ethutils.CustodialProxy]; custodialRegistrationProxy != ethutils.ZeroAddress {
|
||||||
|
var systemAccount common.Address
|
||||||
|
err := chain.Provider().Client.CallCtx(
|
||||||
|
ctx,
|
||||||
|
eth.CallFunc(custodialRegistrationProxy, systemAcccountGetter).Returns(&systemAccount),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if systemAccount != ethutils.ZeroAddress {
|
||||||
|
if err := cache.Add(ctx, systemAccount.Hex()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
lo.Debug("cached custodial system account", "address", systemAccount.Hex())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if accountIndex := registryMap[ethutils.AccountIndex]; accountIndex != ethutils.ZeroAddress {
|
if accountIndex := registryMap[ethutils.AccountIndex]; accountIndex != ethutils.ZeroAddress {
|
||||||
if err := cache.Add(ctx, accountIndex.Hex()); err != nil {
|
if err := cache.Add(ctx, accountIndex.Hex()); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -103,7 +121,6 @@ func bootstrapCache(
|
|||||||
if err := cache.Add(ctx, address.Hex()); err != nil {
|
if err := cache.Add(ctx, address.Hex()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lo.Debug("cached token index batch", "batch_size", len(tokenIndexBatch))
|
lo.Debug("cached token index batch", "batch_size", len(tokenIndexBatch))
|
||||||
|
Loading…
Reference in New Issue
Block a user