test: deterministic EVM tx tests from on-chain Spark transactions#4
Merged
RaghavSood merged 1 commit intomainfrom Feb 24, 2026
Merged
test: deterministic EVM tx tests from on-chain Spark transactions#4RaghavSood merged 1 commit intomainfrom
RaghavSood merged 1 commit intomainfrom
Conversation
Verify ABI encoding, tx building, unit conversion, and vault info tools against real Ethereum mainnet transactions from address 0xE721dd7a654D7E95518014526f6897deF6A44933. Tests cover the full Spark deposit/withdraw lifecycle including USDT approval reset patterns. Also adds GitHub Actions CI workflow for go vet + go test. Co-Authored-By: Claude Opus 4.6 <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
internal/tools/evm_tx_test.go) that verifies MCP tool invocations against real Ethereum mainnet Spark protocol transactions from0xE721dd7a654D7E95518014526f6897deF6A44933.github/workflows/test.yml) forgo vet+go teston push/PR to mainTest Coverage (22 test cases)
ABI Encoding (7 cases) — verifies calldata matches on-chain tx input data:
approve(address,uint256)reset to 0 (USDT pattern)approve(address,uint256)with 1 USDTdeposit(uint256,address)for Spark ERC-4626 vaultwithdraw(uint256,address,address)with accrued interest (2.000029 USDT)allowance(address,address),maxWithdraw(address),assetsOf(address)read callsUnit Conversion (5 cases) — USDT 6-decimal conversions (to_base / to_human)
Transaction Building (5 cases) — builds EIP-1559 txs with exact on-chain parameters (nonces 7-13), decodes via
recipes.DecodeUnsignedPayloadto verify round-trip correctnessVault Info (2 cases) — stores vault keys, validates missing
chain_codeerrorEnd-to-End Workflows (2 cases):
convert_amount→abi_encodeapprove(0) → approve(amount) → deposit →build_evm_txfor eachabi_encodemaxWithdraw → withdraw →build_evm_txDeterminism (1 case) — verifies identical
unsigned_tx_hexoutput across repeated buildsTest plan
go test ./... -count=1)go vet ./...passes🤖 Generated with Claude Code