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

refactor: use api3/chains for chain names in airnode-examples #1925

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

dcroote
Copy link
Contributor

@dcroote dcroote commented Dec 22, 2023

Closes #1741. Surprisingly, this was all that was needed, and the changes are covered by the tests below (and I confirmed in api3/chains that the network names are the same):

describe('getExistingAirnodeRrpV0', () => {
test.each(supportedNetworks)(`confirms AirnodeRrpV0 address is present for supported network - %s`, (name) => {
const address = getExistingAirnodeRrpV0(name);
expect(typeof address).toEqual('string');
});
it('returns the address of the named network', () => {
const network = 'polygon';
const address = getExistingAirnodeRrpV0(network);
expect(address).toBe('0xa0AD79D995DdeeB18a14eAef56A549A04e3Aa1Bd');
});
});

I checked throughout the repo for other instances where references.json of airnode-protocol is used for anything besides contract addresses (e.g. where we use chainNames) and this was it. Airnode logs report "Chain-ID" (example) rather than chain name, and other references to references.json are specific to addresses e.g. here in validator:

const AirnodeRrpV0Addresses: { [chainId: string]: string } = references.AirnodeRrpV0;
const AirnodeRrpV0DryRunAddresses: { [chainId: string]: string } = references.AirnodeRrpV0DryRun;
const RequesterAuthorizerWithErc721Addresses: { [chainId: string]: string } = references.RequesterAuthorizerWithErc721;

@dcroote dcroote self-assigned this Dec 22, 2023
@dcroote dcroote merged commit c3620af into master Dec 22, 2023
25 checks passed
@dcroote dcroote deleted the dcroote/issue1741 branch December 22, 2023 12:38
@dcroote dcroote added this to the 0.14.0 milestone Jan 2, 2024
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.

airnode-node depends on networks in references.json exported by airnode-protocol
2 participants