Skip to content

Conversation

makoto
Copy link
Member

@makoto makoto commented Oct 20, 2025

Add test for the following scenarios so that external indexers have test transactions to index

  • transfer ownership
  • renew name
  • bridge name from l2 to l1 (generate new token id, only update text record on l1, eth address is not updated on l1 hence 0x even though l2 record exists)
  • change role (generate new token id)
  • link names (linked.parent.eth and sub1.sub2.parent.eth share the same registry with same subnames wallet)
  • Reregister expired name
┌────┬─────────────────────────────┬──────────┬─────────┬────────────┬──────────────┬─────────┬────────────────────────────────┐
│    │ Name                        │ Registry │ Owner   │ Expiry     │ Resolver     │ Address │ Description                    │
├────┼─────────────────────────────┼──────────┼─────────┼────────────┼──────────────┼─────────┼────────────────────────────────┤
│  0 │ test.eth                    │ 0x5fc8d  │ 0x70997 │ 2025-10-21 │ 0x4A238 (L2) │ 0x70997 │ test.eth                       │
│  1 │ example.eth                 │ 0x5fc8d  │ 0x70997 │ 2025-10-21 │ 0x7Cf31 (L2) │ 0x70997 │ example.eth                    │
│  2 │ demo.eth                    │ 0x5fc8d  │ 0x70997 │ 2025-10-21 │ 0xe6D46 (L2) │ 0x70997 │ demo.eth                       │
│  3 │ newowner.eth                │ 0x5fc8d  │ 0x90F79 │ 2025-10-21 │ 0xe4347 (L2) │ 0x70997 │ newowner.eth                   │
│  4 │ renew.eth                   │ 0x5fc8d  │ 0x70997 │ 2026-10-21 │ 0x6e66D (L2) │ 0x70997 │ renew.eth                      │
│  5 │ parent.eth                  │ 0x5fc8d  │ 0x70997 │ 2025-10-21 │ 0x786de (L2) │ 0x70997 │ parent.eth                     │
│  6 │ bridge.eth                  │ 0x1291b  │ 0x61017 │ 2025-10-21 │ 0xB4106 (L1) │ 0x00000 │ bridge.eth (bridged to L1)     │
│  7 │ changerole.eth              │ 0x5fc8d  │ 0x70997 │ 2025-10-21 │ 0x6FB83 (L2) │ 0x70997 │ changerole.eth                 │
│  8 │ sub2.parent.eth             │ 0x765FA  │ 0x70997 │ Never      │ 0x1af2c (L2) │ 0x70997 │ sub2.parent.eth                │
│  9 │ sub1.sub2.parent.eth        │ 0xb3752  │ 0x70997 │ Never      │ 0x2217a (L2) │ 0x70997 │ sub1.sub2.parent.eth           │
│ 10 │ wallet.sub1.sub2.parent.eth │ 0x8132B  │ 0x70997 │ Never      │ 0xb8368 (L2) │ 0x70997 │ wallet.sub1.sub2.parent.eth    │
│ 11 │ linked.parent.eth           │ 0x765FA  │ 0x70997 │ Never      │ 0xaCD56 (L2) │ 0x70997 │ Linked to sub1.sub2.parent.eth │
│ 12 │ wallet.linked.parent.eth    │ 0x8132B  │ 0x70997 │ Never      │ 0xb8368 (L2) │ 0x70997 │ wallet.sub1.sub2.parent.eth    │
└────┴─────────────────────────────┴──────────┴─────────┴────────────┴──────────────┴─────────┴────────────────────────────────┘

Still not done for

  • L2 primary name (need to configure l2 primary name first)

Out of scope

  • L1 -> L2 migration (there is a separate script)

@makoto makoto requested review from TateB and adraffy October 20, 2025 07:31
@makoto makoto requested a review from talentlessguy October 20, 2025 08:13
@makoto makoto marked this pull request as ready for review October 20, 2025 08:59
@talentlessguy
Copy link
Contributor

So the devnet now registers those names right? this isn't only for tests

@makoto
Copy link
Member Author

makoto commented Oct 20, 2025

So the devnet now registers those names right? this isn't only for tests

Isn't devnet by definition for test? The script already existed. I only added bunch of other names mimicking various transactions.

@talentlessguy
Copy link
Contributor

So the devnet now registers those names right? this isn't only for tests

Isn't devnet by definition for test? The script already existed. I only added bunch of other names mimicking various transactions.

Wasn't aware that devnet is used for tests as well. Thought it's for integration testing for the front-end mostly

talentlessguy
talentlessguy previously approved these changes Oct 20, 2025
@makoto
Copy link
Member Author

makoto commented Oct 20, 2025

Wasn't aware that devnet is used for tests as well.

oh, you meant for automated test? I checked if example.eth, etc are used in the automated test and it looks not.
The main user of the tests I created are for external indexer like namehash to index against.

Copy link
Member

@adraffy adraffy left a comment

Choose a reason for hiding this comment

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

I added #163 which gives sync() the ability to time warp the devnet.


Since all of these quasi-tests execute on bun run devnet, could we add a flag (see: --procLog), which either enables or disables them?

And I suggest moving all of the functions into a single function in testNames.ts.

// runDevnet.ts
import { testNames } from "./testNames.js";
...
// add "--testNames" to parser
...
if (args.values.testNames) {
   await testNames(env);
}

// testNames.ts
async function testNames(...) {
    await registerTestNames(env, ...);
    await transferName(env, ...);
    await renewName(env, ...);
    ...
}

@makoto
Copy link
Member Author

makoto commented Oct 21, 2025

@adraffy PTAL

@makoto makoto requested a review from adraffy October 23, 2025 06:04
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