Skip to content
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

feat: test improvements #352

Merged
merged 25 commits into from
Jul 5, 2024
Merged

feat: test improvements #352

merged 25 commits into from
Jul 5, 2024

Conversation

TateB
Copy link
Contributor

@TateB TateB commented May 22, 2024

changes:

  • switched from yarn to bun for package manager
  • using typescript esm setup for hardhat (see Support for ESM in TypeScript projects NomicFoundation/hardhat#3385 (comment))
  • test changes
    • all now in typescript
    • removed ethereum-waffle, replaced with @ensdomains/hardhat-chai-matchers-viem for fully typed test matchers
    • using deploy fixtures, instead of shared setup in beforeEach
    • refactored any tests that required the result of a prior test to run correctly, all tests are now entirely independent
    • removed usage of ethers (and in some cases web3) in favour of viem for better types
    • fixed any tests that were not running correctly, or were not testing what was expected
    • ci tests run in parallel
  • deploy changes
    • using viem
    • viem.deploy function [1]
      • viem's deployContract for devnet
      • hardhat-deploy's deploy for live networks
        • for pending transaction save which can be resumed
    • using anvil for testing deploy on ci (significantly faster than hardhat, but doesn't have the same stack tracing)
    • multicall TLD setup for speed + gas efficiency
  • removed unused dependencies (thanks @talentlessguy)

note [1]:
using deploy from hardhat-deploy on a devnet deploy is very slow, which i think is related to ethers provider polling parameters for a receipt (it becomes apparent past the set_tlds deploy script). this is why the usage is switched over for devnet to just use viem's deployContract, but still saves the deployment into hardhat-deploy's deployment manager which allows it to easily be accessed later. live network deploys still use deploy, but speed isn't relevant for them.

@TateB TateB marked this pull request as ready for review June 20, 2024 00:15
@TateB TateB changed the title feat(wip): test improvements feat: test improvements Jun 20, 2024
@TateB TateB requested review from Arachnid and jefflau and removed request for Arachnid June 25, 2024 00:48
} from 'viem'
import { dnsEncodeName } from '../../test/fixtures/dnsEncodeName.js'

const multicallAddress = '0xcA11bde05977b3631167028862bE2a173976CA11'
Copy link
Member

Choose a reason for hiding this comment

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

A comment stating where this comes from would be helpful.

@talentlessguy talentlessguy merged commit 3c96089 into staging Jul 5, 2024
3 checks passed
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