Skip to content

test(evm): deploy test contracts with eth_sendRawTransactionSync - #79

Merged
kyscott18 merged 1 commit into
mainfrom
test/sync-deploy
Oct 26, 2026
Merged

kyscott18 merged 1 commit into
mainfrom
test/sync-deploy

Conversation

@kyscott18

Copy link
Copy Markdown
Collaborator

Summary

  • deployArtifact and deployTestToken send the deploy with eth_sendRawTransactionSync (EIP-7966), which returns the receipt once the tx is mined.
  • Before, anvil replied to eth_sendRawTransaction before the receipt existed (20 of 20 sends, with or without --network monad, automine on). waitForTransactionReceipt often missed its first check and waited viem's 4s polling interval, the default for a chain with no blockTime.
  • deployTestToken now calls deployArtifact with the constructor args.

Results

bun test src/index.test.ts in packages/typewriter-evm: 5–40s before (a test that deploys twice could pass bun's default 5s timeout), about 0.7s after.

Test plan

  • bun run lint, tsc --noEmit
  • bun test --timeout 30000 src/index.test.ts 3 runs, 28 pass each

🤖 Generated with Claude Code

Anvil replies to eth_sendRawTransaction before the receipt exists, so
waitForTransactionReceipt often missed its first check and waited viem's
4s polling interval. index.test.ts took 5-40s and could exceed bun's
default 5s test timeout. It now runs in about 0.7s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyscott18
kyscott18 merged commit 62708bc into main Oct 26, 2026
7 checks passed
@kyscott18
kyscott18 deleted the test/sync-deploy branch October 26, 2026 20:44
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.

1 participant