From b00c07222a00701868dceac85ea975b794b9596e Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 29 Nov 2024 11:53:00 +0100 Subject: [PATCH] Improve naming --- contracts/fee_currencies.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contracts/fee_currencies.go b/contracts/fee_currencies.go index 1fcdb23d62..2777cd25d9 100644 --- a/contracts/fee_currencies.go +++ b/contracts/fee_currencies.go @@ -30,7 +30,8 @@ func init() { } } -func getDirectoryAddress(chainId *big.Int) common.Address { +// Returns the address of the FeeCurrencyDirectory contract for the given chainId +func getFeeCurrencyDirectoryAddress(chainId *big.Int) common.Address { // ChainId can be uninitialized in some tests if chainId == nil { return addresses.FeeCurrencyDirectoryAddress @@ -206,7 +207,7 @@ func GetRegisteredCurrencies(caller *abigen.FeeCurrencyDirectoryCaller) ([]commo // GetExchangeRates returns the exchange rates for the provided gas currencies func GetExchangeRates(caller *CeloBackend) (common.ExchangeRates, error) { - directory, err := abigen.NewFeeCurrencyDirectoryCaller(getDirectoryAddress(caller.ChainConfig.ChainID), caller) + directory, err := abigen.NewFeeCurrencyDirectoryCaller(getFeeCurrencyDirectoryAddress(caller.ChainConfig.ChainID), caller) if err != nil { return common.ExchangeRates{}, fmt.Errorf("failed to access FeeCurrencyDirectory: %w", err) } @@ -220,7 +221,7 @@ func GetExchangeRates(caller *CeloBackend) (common.ExchangeRates, error) { // GetFeeCurrencyContext returns the fee currency block context for all registered gas currencies from CELO func GetFeeCurrencyContext(caller *CeloBackend) (common.FeeCurrencyContext, error) { var feeContext common.FeeCurrencyContext - directory, err := abigen.NewFeeCurrencyDirectoryCaller(getDirectoryAddress(caller.ChainConfig.ChainID), caller) + directory, err := abigen.NewFeeCurrencyDirectoryCaller(getFeeCurrencyDirectoryAddress(caller.ChainConfig.ChainID), caller) if err != nil { return feeContext, fmt.Errorf("failed to access FeeCurrencyDirectory: %w", err) }