Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more verbosity to contract-address getter defaults #305

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

ezdac
Copy link

@ezdac ezdac commented Jan 7, 2025

Before the GetAddresses function silently returned the mainnet addresses as a default value, without the caller being made aware of this.

Now, the GetAddresses function will return nil whenever it does not explicitly map the passed in chain-id to a set of addresses.

The newly added GetAddressesOrDefault function allows for retrieving the addresses with a default fallback for easier use in inline calls. This replicates the behavior of the old GetAddresses functionality with more verbosity.

Before the `GetAddresses` function silently returned the
mainnet addresses as a default value, without the caller
being made aware of this.

Now, the `GetAddresses` function will return `nil` whenever
it does not explicitly maps the passed in chain-id to a set
of addresses.

The newly added `GetAddressesOrDefault` function allows for
retrieving the addresses with a default fallback for
easier use in inline calls. This replicates the behavior
of the old `GetAddresses` functionality with more verbosity.
@ezdac ezdac requested a review from palango January 7, 2025 10:48
Copy link

@palango palango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense when looking at the changes required for the optimism repository.

@ezdac ezdac merged commit dd40725 into celo11 Jan 7, 2025
8 checks passed
@ezdac ezdac deleted the ezdac/address-getter-verbosity branch January 7, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants