Skip to content

refactor(eth): replace deprecated SignedIntValueEncoder with UintValu… - #2733

Open
expertdicer wants to merge 1 commit into
mainfrom
expertdicer/uint-value-encoder
Open

refactor(eth): replace deprecated SignedIntValueEncoder with UintValu…#2733
expertdicer wants to merge 1 commit into
mainfrom
expertdicer/uint-value-encoder

Conversation

@expertdicer

Copy link
Copy Markdown
Contributor

…eEncoder

Abstract

collections.IntValueEncoder used to delegate to IntKeyEncoder, which panics on negative or nil sdkmath.Int values. That was misleading for signed state (e.g. wei block deltas) and unsafe for callers that expected a general signed int encoder.

This PR splits signed value encoding from unsigned fixed-width encoding: IntValueEncoder now marshals signed sdkmath.Int, a new UintValueEncoder keeps the existing 32-byte big-endian format for non-negative persisted state, and weiStore is typed as sdkmath.Uint. eth.SignedIntValueEncoder is removed in favor of the generic collections encoder.

@expertdicer
expertdicer requested a review from a team as a code owner August 7, 2026 11:22
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
x/collections/value_encoder.go 79.16% 3 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

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.

[bug] The IntKeyEncoder.Encode function panics if the input math.Int is nil or negative.

1 participant