Conversation
README.md
Outdated
| ## License | ||
|
|
||
| MIT | ||
| This branch mainly targeted on ENS interactions No newline at end of file |
There was a problem hiding this comment.
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.
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.
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.
Move static string checking var to a constants file
|
|
||
|
|
||
|
|
||
| resolveAddress("0x44aDbAcC4B0baD81dBc6D24b9512da3806c5aCCD") |
There was a problem hiding this comment.
Add more test cases to check the functionality for example add negative test cases too
tsconfig.json
Outdated
| "declaration": true | ||
| }, | ||
| "include": ["./src/**/*"], | ||
| "include": ["./src/**/*", "testENSresolve.ts"], |
There was a problem hiding this comment.
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:
***@***.***>
|
ex-rohan-edx
left a comment
There was a problem hiding this comment.
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.