Sitelet https://github.com/shazow/whatsabi/commit/cb2afbbc07177cdac583bf281efbaf952822e0a1
Skip to content

Commit cb2afbb

Browse files
committed
tests: route Blockscout through the multichain gateway in CI
Blockscout deprecated per-instance APIs (eth.blockscout.com) in favor of the Pro API gateway on 2026-07-01; unauthenticated instance requests now hit a Cloudflare challenge. Pass BLOCKSCOUT_API_KEY into the test env and use it with chainId 1 so mainnet tests go through api.blockscout.com. Keyless runs keep the legacy instance API. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HMUp44Us9CCEgXXWW2yV76
1 parent 2f2f477 commit cb2afbb

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ jobs:
3232
ONLINE: 1
3333
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
3434
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
35+
BLOCKSCOUT_API_KEY: ${{ secrets.BLOCKSCOUT_API_KEY }}

‎src/__tests__/loaders.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ describe('loaders: ABILoader', () => {
6363
online_test('BlockscoutABILoader', async ({ env }) => {
6464
const loader = new BlockscoutABILoader({
6565
apiKey: env["BLOCKSCOUT_API_KEY"],
66+
// A key routes through the multichain gateway; keyless keeps the legacy instance API
67+
chainId: env["BLOCKSCOUT_API_KEY"] ? 1 : undefined,
6668
});
6769
const abi = await loader.loadABI("0x7a250d5630b4cf539739df2c5dacb4c659f2488d");
6870
const selectors = Object.values(selectorsFromABI(abi));
@@ -161,6 +163,8 @@ describe('loaders: ABILoader', () => {
161163
online_test('BlockscoutABILoader_getContract', async ({ env }) => {
162164
const loader = new BlockscoutABILoader({
163165
apiKey: env["BLOCKSCOUT_API_KEY"],
166+
// A key routes through the multichain gateway; keyless keeps the legacy instance API
167+
chainId: env["BLOCKSCOUT_API_KEY"] ? 1 : undefined,
164168
});
165169
const result = await loader.getContract("0x7a250d5630b4cf539739df2c5dacb4c659f2488d");
166170
const selectors = Object.values(selectorsFromABI(result.abi));
@@ -178,6 +182,8 @@ describe('loaders: ABILoader', () => {
178182
online_test('BlockscoutABILoader_getContract_UniswapV3Factory', async ({ env }) => {
179183
const loader = new BlockscoutABILoader({
180184
apiKey: env["BLOCKSCOUT_API_KEY"],
185+
// A key routes through the multichain gateway; keyless keeps the legacy instance API
186+
chainId: env["BLOCKSCOUT_API_KEY"] ? 1 : undefined,
181187
});
182188
const { abi, name } = await loader.getContract("0x1F98431c8aD98523631AE4a59f267346ea31F984");
183189
const selectors = Object.values(selectorsFromABI(abi));
@@ -485,7 +491,7 @@ describe_cached("loaders: ABILoader suite", async ({ env }) => {
485491
const loaders = [
486492
new SourcifyABILoader(),
487493
new EtherscanV2ABILoader({ apiKey: env["ETHERSCAN_API_KEY"] }),
488-
new BlockscoutABILoader({ apiKey: env["BLOCKSCOUT_API_KEY"] }),
494+
new BlockscoutABILoader({ apiKey: env["BLOCKSCOUT_API_KEY"], chainId: env["BLOCKSCOUT_API_KEY"] ? 1 : undefined }),
489495
new AnyABILoader(),
490496
];
491497

0 commit comments

Comments
 (0)