Skip to content

refactor: address review comments on legacy adapter - #2

Draft
JordiParraCrespo wants to merge 1 commit into
fix/legacy-state-readsfrom
refactor/address-pr12-legacy-review
Draft

refactor: address review comments on legacy adapter#2
JordiParraCrespo wants to merge 1 commit into
fix/legacy-state-readsfrom
refactor/address-pr12-legacy-review

Conversation

@JordiParraCrespo

Copy link
Copy Markdown
Owner

Summary

Addresses the review feedback left on xrplevm/evm#12 (fix: decode pre-v9 state via height-dispatched legacy adapter). Pure renames / comment cleanups — no behavior change.

This PR is based on the fix/legacy-state-reads branch (a copy of PR xrplevm#12) inside this fork, so the diff shown here is only the review fixes.

Changes (per review comment)

Comment Change
adapter.go — generic naming (xrplevm#3/xrplevm#4) const V9const CosmosEVMUpgradeName (value "v9.0.0" unchanged); doc comment updated
adapter.go:40 (#2) struct field v9HeightcosmosEvmHeight
params.go:20 (xrplevm#6) method UnmarshalLegacyParamsUnmarshalParams (unify with GetCodeHash / UnmarshalFeeMarketParams, which carry no Legacy prefix)
params.go:61 (xrplevm#7) naming now consistent between UnmarshalParams and UnmarshalFeeMarketParams
params.go:26 + package doc (xrplevm#8) removed the arrows from comments
adapter_test.go:19 (xrplevm#5) test helper loadedAdapternewLoadedTestLegacyAdapter

Call sites updated: x/vm/keeper/params.go, legacy/legacytestutil, and the legacy tests.

On the generic-version comment (xrplevm#3/xrplevm#4)

Kept the upgrade name as a single, properly-named exported constant (CosmosEVMUpgradeName) rather than a full pluggable/configurable redesign, per the scope agreed for this follow-up.

Not changed here — evmd/app.go Load() question (#1)

That comment is a question about whether the legacyAdapter.Load() in LoadHeight is redundant given the load in the constructor. Left untouched pending author discussion (analysis provided separately).

Verification

  • gofmt -l legacy x/vm/keeper/params.go — clean
  • go build ./... — passes (root module and evmd/)
  • go test ./legacy/... — passes

🤖 Generated with Claude Code

https://claude.ai/code/session_01R63pArhK88pBunBwBHgzn9


Generated by Claude Code

Rename for clarity, per review feedback on PR xrplevm#12:
- const V9 -> CosmosEVMUpgradeName
- LegacyAdapter.v9Height field -> cosmosEvmHeight
- UnmarshalLegacyParams -> UnmarshalParams (unify with GetCodeHash /
  UnmarshalFeeMarketParams naming)
- test helper loadedAdapter -> newLoadedTestLegacyAdapter
- drop the "->" arrows from doc comments

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R63pArhK88pBunBwBHgzn9
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.

2 participants