fix: implement AdaptUnmarshalParams #7
Merged
AdriaCarrera merged 2 commits intorelease/v0.6.x-xrplevm.xfrom Mar 11, 2026
Merged
fix: implement AdaptUnmarshalParams #7AdriaCarrera merged 2 commits intorelease/v0.6.x-xrplevm.xfrom
AdriaCarrera merged 2 commits intorelease/v0.6.x-xrplevm.xfrom
Conversation
…rrent and legacy schemas
20765f9
into
release/v0.6.x-xrplevm.x
10 of 20 checks passed
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.
Description
This pull request introduces a compatibility adapter for EVM parameters, allowing the system to seamlessly handle both the current
cosmos.evmschema and the legacy Ethermint schema. The main change is the addition of a robust unmarshalling function, which is now used by the keeper to read parameters, ensuring smooth upgrades and backward compatibility. Comprehensive tests are added to verify correct behavior across all supported scenarios.Core compatibility improvements:
AdaptUnmarshalParamsinx/vm/keeper/adapter.goto transparently unmarshal EVM params from either the current or legacy schema, converting fields as needed and handling schema incompatibilities.Keeper.GetParamsinx/vm/keeper/params.goto useAdaptUnmarshalParams, ensuring that parameter reads work regardless of the underlying schema, and panic on unrecoverable errors.Testing and validation:
x/vm/keeper/adapter_test.gowith unit tests covering current schema, legacy schema, minimal legacy params, invalid legacy values, and random bytes, ensuring the adapter behaves correctly in all edge cases.x/vm/keeper/params_test.gowith integration-style tests forGetParams, verifying correct operation with empty stores, both schemas, and error handling for invalid data.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
mainbranch