-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ethclient: fix unmarshaling of ethereum.SyncProgress #24199
Conversation
SyncProgress was modified in PR ethereum#23576 to add the fields reported for snap sync. The PR also changed ethclient to use the SyncProgress struct directly instead of wrapping it for hex-decoding. This broke the SyncProgress method. Fix it by putting back the custom wrapper. While here, also put back the fast sync related fields because SyncProgress is stable API and thus removing fields is not allowed.
@@ -542,3 +542,51 @@ func toCallArg(msg ethereum.CallMsg) interface{} { | |||
} | |||
return arg | |||
} | |||
|
|||
// rpcProgress is a copy of SyncProgress with hex-encoded fields. | |||
type rpcProgress struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these have json tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They didn't have before because all the fields work with the default mapping, and this struct is only used for decoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks everyone! |
SyncProgress was modified in PR ethereum#23576 to add the fields reported for snap sync. The PR also changed ethclient to use the SyncProgress struct directly instead of wrapping it for hex-decoding. This broke the SyncProgress method. Fix it by putting back the custom wrapper. While here, also put back the fast sync related fields because SyncProgress is stable API and thus removing fields is not allowed. Fixes ethereum#24180 Fixes ethereum#24176
SyncProgress was modified in PR ethereum#23576 to add the fields reported for snap sync. The PR also changed ethclient to use the SyncProgress struct directly instead of wrapping it for hex-decoding. This broke the SyncProgress method. Fix it by putting back the custom wrapper. While here, also put back the fast sync related fields because SyncProgress is stable API and thus removing fields is not allowed. Fixes ethereum#24180 Fixes ethereum#24176
SyncProgress was modified in PR #23576 to add the fields reported for
snap sync. The PR also changed ethclient to use the SyncProgress struct
directly instead of wrapping it for hex-decoding. This broke the
SyncProgress method.
Fix it by putting back the custom wrapper. While here, also put back the
fast sync related fields because SyncProgress is stable API and thus
removing fields is not allowed.
Fixes #24180