Repository navigation
test(evm): deploy test contracts with eth_sendRawTransactionSync - #79
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deployArtifactanddeployTestTokensend the deploy witheth_sendRawTransactionSync(EIP-7966), which returns the receipt once the tx is mined.eth_sendRawTransactionbefore the receipt existed (20 of 20 sends, with or without--network monad, automine on).waitForTransactionReceiptoften missed its first check and waited viem's 4s polling interval, the default for a chain with noblockTime.deployTestTokennow callsdeployArtifactwith the constructor args.Results
bun test src/index.test.tsinpackages/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 --noEmitbun test --timeout 30000 src/index.test.ts3 runs, 28 pass each🤖 Generated with Claude Code