Skip to content

Conversation

@Marketen
Copy link
Contributor

@Marketen Marketen commented May 22, 2023

Even thought this PR initially aimed with the objective of replacing the "Apm" class inside "src/utils/Apm.ts" file for dappnode's toolkit, as I was replacing it, I realised that this class was only used for resolving ENS names to addresses via it's ethereum Provider parameter, nothing specific to the Aragon Packet Manager.

The only Aragorn Packet Manager related methods are "encodeNewRepoWithVersionCall()" and "encodeNewVersionCall()" (which are not part of the Apm class itself, but are inside the same file).

So, in the end, this PR does the following:

  • Delete "Apm" class inside src/utils/Apm.ts and replacing it for utility functions that interact with ENS names. Modified function "getEthereumProviderUrl()" to be exported, added "isValidENSName()" function to check if a ENS is valid before trying to interact with it.
  • Refactor of "src/utils/verifyEthConnection.ts" so that it uses only an ethereum provider when checking if provider can connect properly, and not the whole Apm class.
  • Integrated toolkint into "src/utils/versions/getNextVersionFromApm.ts"
  • Updated tests affected by all the above changes.

Since CI is down atm, I ran all tests locally and passed.

TODO: We should consider adding "encodeNewRepoWithVersionCall()" and "encodeNewVersionCall()" to the dappnode toolkit, and then updating the SDK code again. Also, we should rename "src/utils/Apm.ts" file name, but kept it the same so reviewing this PR is easier

@Marketen Marketen requested a review from a team as a code owner May 22, 2023 22:25
@Marketen Marketen changed the title integrate apm-repo toolkit into SDK Refactor Apm class & integrate toolkit's ApmRepository class May 22, 2023
@Marketen Marketen self-assigned this May 22, 2023
@Marketen Marketen added the P1 Has to be done but not urgent label May 22, 2023
@Marketen Marketen force-pushed the marc/integrate-apm-toolkit branch from 9ee3648 to a9f6e59 Compare May 24, 2023 11:29
@github-actions
Copy link

github-actions bot commented May 24, 2023

DAppNode bot has built and pinned the release to an IPFS node, for commit: cab8455

This is a development version and should only be installed for testing purposes, install link

/ipfs/QmP54nug2Lts5YvurF51YFsG1sdDgvgATRxcmbgHkZDPoL

(by dappnodebot/build-action)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 Has to be done but not urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants