-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/ens #9
base: dev-nish
Are you sure you want to change the base?
Feature/ens #9
Conversation
README.md
Outdated
## License | ||
|
||
MIT | ||
This branch mainly targeted on ENS interactions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert back to old READ ME file
src/classes/EdexaClient.ts
Outdated
const provider = new ethers.providers.JsonRpcProvider(RPC_URL) | ||
const reverseName = `${input.slice(2)}.addr.reverse`; | ||
const node = ethers.utils.namehash(reverseName); | ||
const resolverContract_ = new ethers.Contract('0xEF1db68FaDfdD398886EE73Cbc34918Be51Ae304', publicResolver.abi, provider); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move static contract address into a constants file
src/classes/EdexaClient.ts
Outdated
throw new Error(`ENS Not Registered for ${input}`) | ||
else return detailsObject.resolver | ||
const node = ethers.utils.namehash(input); | ||
const resolverContract_ = new ethers.Contract('0xEF1db68FaDfdD398886EE73Cbc34918Be51Ae304', publicResolver.abi, provider); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move static contract address into a constants file
src/classes/EdexaClient.ts
Outdated
async resolveName(input: string) { //name string input | ||
try { | ||
// Check if the input is a valid Ethereum address | ||
if (input.endsWith(".edx") && input.split(".")[0].length >= 4) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move static string checking var to a constants file
|
||
|
||
|
||
resolveAddress("0x44aDbAcC4B0baD81dBc6D24b9512da3806c5aCCD") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more test cases to check the functionality for example add negative test cases too
tsconfig.json
Outdated
@@ -18,6 +18,6 @@ | |||
"esModuleInterop": true, | |||
"declaration": true | |||
}, | |||
"include": ["./src/**/*"], | |||
"include": ["./src/**/*", "testENSresolve.ts"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset back to original file
updated
…On Wed, Apr 24, 2024 at 11:29 AM Rohan Jain ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In README.md
<#9 (comment)>:
> -```
-
-### NPM publish
-
-Before running the publish script, make sure you have updated the version properly.
-
-Note that the `prepublishOnly` script will be automatically called while publishing. It will check lint, clean `dist/lib` folders, and build fresh distribution files before executing `npm publish`.
-
-```bash
-npm publish
-```
-
-## License
-
-MIT
+This branch mainly targeted on ENS interactions
Revert back to old READ ME file
------------------------------
In src/classes/EdexaClient.ts
<#9 (comment)>:
> try {
// Check if the input is a valid Ethereum address
if (ethers.utils.isAddress(input)) {
- return input
+
+ const provider = new ethers.providers.JsonRpcProvider(RPC_URL)
+ const reverseName = `${input.slice(2)}.addr.reverse`;
+ const node = ethers.utils.namehash(reverseName);
+ const resolverContract_ = new ethers.Contract('0xEF1db68FaDfdD398886EE73Cbc34918Be51Ae304', publicResolver.abi, provider);
Move static contract address into a constants file
------------------------------
In src/classes/EdexaClient.ts
<#9 (comment)>:
> - ensAbi,
- provider,
- )
-
- // Resolve the ENS domain to an Ethereum address
- const detailsObject = await ens.getDomainInfo(input)
-
- if (detailsObject) {
- if (
- detailsObject.resolver ==
- '0x0000000000000000000000000000000000000000'
- )
- throw new Error(`ENS Not Registered for ${input}`)
- else return detailsObject.resolver
+ const node = ethers.utils.namehash(input);
+ const resolverContract_ = new ethers.Contract('0xEF1db68FaDfdD398886EE73Cbc34918Be51Ae304', publicResolver.abi, provider);
Move static contract address into a constants file
------------------------------
In src/classes/EdexaClient.ts
<#9 (comment)>:
> } else {
+ return "input is not an address";
+
+ }
+ } catch (error) {
+ throw new Error(`Error: ${error.message}`)
+ }
+ }
+ async resolveName(input: string) { //name string input
+ try {
+ // Check if the input is a valid Ethereum address
+ if (input.endsWith(".edx") && input.split(".")[0].length >= 4) {
Move static string checking var to a constants file
------------------------------
In testENSresolve.ts
<#9 (comment)>:
> +
+ let edexaclient = new EdexaClient();
+ let ens = await edexaclient.resolveAddr(input);
+ console.log("ens name of",input, " is:",ens)
+
+ }
+async function resolveName(input : string) {
+
+ let edexaclient = new EdexaClient();
+ let add = await edexaclient.resolveName(input);
+ console.log("address of",input, " is:",add)
+}
+
+
+
+resolveAddress("0x44aDbAcC4B0baD81dBc6D24b9512da3806c5aCCD")
Add more test cases to check the functionality for example add negative
test cases too
------------------------------
In tsconfig.json
<#9 (comment)>:
> @@ -18,6 +18,6 @@
"esModuleInterop": true,
"declaration": true
},
- "include": ["./src/**/*"],
+ "include": ["./src/**/*", "testENSresolve.ts"],
Reset back to original file
—
Reply to this email directly, view it on GitHub
<#9 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BHKYY3R24DUZGDLQICEO5MLY65C3RAVCNFSM6AAAAABGOPR2K6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAMJYHEYDQNRRGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Comments:
- Add comments to each function describing:
- The function's purpose.
- The types of arguments it accepts.
- What the function returns.
Test Case Improvement:
- Specify the expected results in your test cases to clarify what the test is verifying.
- Use descriptive names for your test cases to indicate the aspect of the function being tested.
No description provided.