Skip to content

Conversation

@PierreJeanjacquot
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements dapp address resolution from Compass service as a fallback mechanism when ENS is not supported on a network. The change allows the SDK to dynamically resolve dapp addresses from the Compass API when static configuration is unavailable.

  • Adds a new utility function to fetch dapp addresses from Compass API endpoints
  • Updates the SDK initialization to use Compass resolution as a fallback when dapp address is not configured
  • Modifies chain configuration to mark ENS-unsupported networks with undefined dapp addresses

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/resolveDappAddressFromCompass.ts New utility function to fetch dapp addresses from Compass API with error handling
src/web3telegram/IExecWeb3telegram.ts Integrates Compass resolution into SDK initialization flow as fallback mechanism
src/config/config.ts Updates Arbitrum Sepolia config to use undefined dapp address since ENS is not supported
tests/unit/utils/resolveDappAddressFromCompass.test.ts Unit tests for the new Compass resolution utility function
tests/e2e/constructor.test.ts E2E tests validating Compass-based address resolution in constructor
package.json Updates iexec dependency to version 8.17.0
Comments suppressed due to low confidence (2)

tests/unit/utils/resolveDappAddressFromCompass.test.ts:17

  • This test relies on an external network call to an invalid URL. Consider mocking the fetch call to make the test more reliable and faster.
  it('should throw CompassCallError on network error', async () => {

tests/unit/utils/resolveDappAddressFromCompass.test.ts:10

  • This test makes a real HTTP request to an external service. Consider mocking the fetch call to avoid dependency on external services and improve test reliability.
  it('should resolve dapp address from a valid compass instance', async () => {

);
}
const contentType = response.headers.get('Content-Type');
if (!contentType || contentType.indexOf('application/json') === -1) {
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Use includes() method instead of indexOf() for better readability and modern JavaScript practices.

Suggested change
if (!contentType || contentType.indexOf('application/json') === -1) {
if (!contentType || !contentType.includes('application/json')) {

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@SeddikBellamine SeddikBellamine left a comment

Choose a reason for hiding this comment

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

LGTM

@PierreJeanjacquot PierreJeanjacquot merged commit 9895a48 into main Jul 23, 2025
4 checks passed
@PierreJeanjacquot PierreJeanjacquot deleted the feat/compass-resolve branch July 23, 2025 13:40
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.

3 participants