mirror of
				https://github.com/grassrootseconomics/eth-tracker.git
				synced 2025-11-04 10:28:22 +01:00 
			
		
		
		
	Merge branch 'master' into cel2
This commit is contained in:
		
						commit
						dd663ba921
					
				
							
								
								
									
										23
									
								
								internal/cache/bootstrap.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								internal/cache/bootstrap.go
									
									
									
									
										vendored
									
									
								
							@ -22,8 +22,9 @@ func bootstrapCache(
 | 
			
		||||
	lo *slog.Logger,
 | 
			
		||||
) error {
 | 
			
		||||
	var (
 | 
			
		||||
		tokenRegistryGetter = w3.MustNewFunc("tokenRegistry()", "address")
 | 
			
		||||
		quoterGetter        = w3.MustNewFunc("quoter()", "address")
 | 
			
		||||
		tokenRegistryGetter  = w3.MustNewFunc("tokenRegistry()", "address")
 | 
			
		||||
		quoterGetter         = w3.MustNewFunc("quoter()", "address")
 | 
			
		||||
		systemAcccountGetter = w3.MustNewFunc("systemAccount()", "address")
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
	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 err := cache.Add(ctx, accountIndex.Hex()); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
@ -103,7 +121,6 @@ func bootstrapCache(
 | 
			
		||||
						if err := cache.Add(ctx, address.Hex()); err != nil {
 | 
			
		||||
							return err
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				lo.Debug("cached token index batch", "batch_size", len(tokenIndexBatch))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user