Skip to content

Commit e8d6f0c

Browse files
authored
fix(adapter-polkadot): align hub explorer labels with routescan (#364)
Update the remaining Polkadot Hub explorer labels, guidance, and placeholders so the UI matches the Routescan-backed mainnet configuration.
1 parent 005438b commit e8d6f0c

7 files changed

Lines changed: 22 additions & 15 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openzeppelin/ui-builder-adapter-polkadot': patch
3+
---
4+
5+
Rename remaining Polkadot Hub explorer UI labels and guidance from Blockscout to Routescan.

packages/adapter-polkadot/src/__tests__/adapter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ describe('PolkadotAdapter', () => {
130130
});
131131

132132
describe('getSupportedContractDefinitionProviders', () => {
133-
it('should return Blockscout for Hub networks', () => {
133+
it('should return Routescan for Hub networks', () => {
134134
const adapter = new PolkadotAdapter(mockPolkadotHubConfig as unknown as NetworkConfig);
135135
const providers = adapter.getSupportedContractDefinitionProviders();
136-
expect(providers).toContainEqual({ key: 'etherscan', label: 'Blockscout' });
136+
expect(providers).toContainEqual({ key: 'etherscan', label: 'Routescan' });
137137
expect(providers).toContainEqual({ key: 'sourcify', label: 'Sourcify' });
138138
expect(providers).toContainEqual({ key: 'manual', label: 'Manual' });
139139
});

packages/adapter-polkadot/src/__tests__/networks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Polkadot Hub Network Configurations', () => {
6060
// expect(kusamaHubMainnet.nativeCurrency.decimals).toBe(18);
6161
// });
6262
//
63-
// it('should use Blockscout (Etherscan V1 API)', () => {
63+
// it('should use Routescan (Etherscan-compatible V1 API)', () => {
6464
// expect(kusamaHubMainnet.supportsEtherscanV2).toBe(false);
6565
// });
6666
// });

packages/adapter-polkadot/src/adapter.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ export class PolkadotAdapter implements ContractAdapter {
199199

200200
/**
201201
* Load a contract schema from an address or artifacts.
202-
* Uses Blockscout (V1 API) for Hub networks, Moonscan (V2 API) for parachains.
202+
* Uses Routescan (Etherscan-compatible V1 API) for Hub networks and Moonscan (V2 API)
203+
* for parachains.
203204
* Falls back to Sourcify if primary provider fails.
204205
*
205206
* [SUBSTRATE TODO]: ink! contracts would need different loading:
@@ -282,13 +283,13 @@ export class PolkadotAdapter implements ContractAdapter {
282283

283284
/**
284285
* Get supported contract definition providers.
285-
* Returns Etherscan (for Blockscout/Moonscan) and Sourcify.
286+
* Returns Etherscan-compatible providers (Routescan/Moonscan) and Sourcify.
286287
*/
287288
getSupportedContractDefinitionProviders(): Array<{ key: string; label: string }> {
288289
return [
289290
{
290291
key: 'etherscan',
291-
label: this._typedNetworkConfig.networkCategory === 'hub' ? 'Blockscout' : 'Moonscan',
292+
label: this._typedNetworkConfig.networkCategory === 'hub' ? 'Routescan' : 'Moonscan',
292293
},
293294
{ key: 'sourcify', label: 'Sourcify' },
294295
{ key: 'manual', label: 'Manual' },

packages/adapter-polkadot/src/evm/abi/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import type { TypedPolkadotNetworkConfig } from '../../types';
1818

1919
/**
2020
* Load a contract using EVM core module.
21-
* Uses Blockscout (V1 API) for Hub networks, Moonscan (V2 API) for parachains.
21+
* Uses Routescan (Etherscan-compatible V1 API) for Hub networks and Moonscan (V2 API)
22+
* for parachains.
2223
*
2324
* @remarks
2425
* This is a thin wrapper that handles the Polkadot-specific option format

packages/adapter-polkadot/src/evm/configuration/network-services.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function getPolkadotDefaultServiceConfig(
6767
* Get explorer label based on network category.
6868
*/
6969
function getExplorerLabel(networkConfig: TypedPolkadotNetworkConfig): string {
70-
return networkConfig.networkCategory === 'hub' ? 'Blockscout' : 'Moonscan';
70+
return networkConfig.networkCategory === 'hub' ? 'Routescan' : 'Moonscan';
7171
}
7272

7373
/**
@@ -130,7 +130,7 @@ export function getNetworkServiceForms(
130130
lines: [
131131
`<strong>${explorerLabel}:</strong> The primary block explorer for this network.`,
132132
networkConfig.networkCategory === 'hub'
133-
? '<strong>Note:</strong> Hub networks use Blockscout API (V1 compatible).'
133+
? '<strong>Note:</strong> Hub networks use Routescan (Etherscan-compatible V1 API).'
134134
: '<strong>Note:</strong> Parachain networks use Moonscan (Etherscan V2 compatible).',
135135
],
136136
},
@@ -150,10 +150,10 @@ export function getNetworkServiceForms(
150150
id: 'polkadot-explorer-use-v2',
151151
name: 'useV2Api',
152152
type: 'checkbox',
153-
label: `Use ${networkConfig.networkCategory === 'hub' ? 'Blockscout' : 'Etherscan V2'} API`,
153+
label: `Use ${networkConfig.networkCategory === 'hub' ? 'Routescan' : 'Etherscan V2'} API`,
154154
helperText:
155155
networkConfig.networkCategory === 'hub'
156-
? 'Hub networks use Blockscout API which is V1 compatible.'
156+
? 'Hub networks use Routescan, which exposes an Etherscan-compatible V1 API.'
157157
: 'Enable the V2 API for Moonscan networks.',
158158
validation: {},
159159
defaultValue: v2DefaultEnabled && networkConfig.networkCategory !== 'hub',
@@ -184,7 +184,7 @@ export function getNetworkServiceForms(
184184
label: 'Explorer Base URL (optional)',
185185
placeholder:
186186
networkConfig.networkCategory === 'hub'
187-
? 'https://assethub-polkadot.blockscout.com'
187+
? 'https://polkadot.routescan.io'
188188
: 'https://moonbeam.moonscan.io',
189189
validation: {},
190190
helperText:
@@ -203,7 +203,7 @@ export function getNetworkServiceForms(
203203
label: 'Explorer API URL',
204204
placeholder:
205205
networkConfig.networkCategory === 'hub'
206-
? 'https://assethub-polkadot.blockscout.com/api'
206+
? 'https://api.routescan.io/v2/network/mainnet/evm/420420419/etherscan/api'
207207
: 'https://api.moonscan.io/api',
208208
validation: {},
209209
helperText:
@@ -268,7 +268,7 @@ export function getNetworkServiceForms(
268268
validation: {},
269269
options: [
270270
{
271-
label: networkConfig.networkCategory === 'hub' ? 'Blockscout' : 'Moonscan',
271+
label: networkConfig.networkCategory === 'hub' ? 'Routescan' : 'Moonscan',
272272
value: EvmProviderKeys.Etherscan,
273273
},
274274
{ label: 'Sourcify', value: EvmProviderKeys.Sourcify },

packages/adapter-polkadot/src/metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const ecosystemMetadata: EcosystemMetadata = {
77
name: 'Polkadot',
88
description:
99
'Polkadot is a heterogeneous multi-chain protocol enabling cross-chain communication and shared security. It supports EVM-compatible smart contracts through Hub networks and parachains like Moonbeam.',
10-
explorerGuidance: 'Blockscout or Moonscan verified contracts',
10+
explorerGuidance: 'Routescan or Moonscan verified contracts',
1111
addressExample: '0x...',
1212
iconComponent: NetworkPolkadot,
1313
bgColorClass: 'bg-pink-100',

0 commit comments

Comments
 (0)