-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix bad geth log decoding #2476
Fix bad geth log decoding #2476
Conversation
require.Equal(t, common.HexToAddress("f17f52151ebef6c7334fad080c5704d77216b732"), newRoundLog.StartedBy) | ||
require.Equal(t, int64(15), newRoundLog.StartedAt.Int64()) | ||
|
||
type BadLogNewRound 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.
Why is it bad ?
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.
In Solidity, the round ID field is roundId
. Geth's Go code expects this to translate to RoundId
, not RoundID
, and fails to find the field if it doesn't.
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.
ethereum/go-ethereum#16648 <- does go-eth support these 'abi' tags?
i.e.
type MyEventParameters struct {
Value1 *big.Int `abi:"value"`
}
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.
Only on non-indexed fields. I plan to rework their decoding logic in a subsequent PR to add this feature for indexed fields.
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.
Ok as long as it was considered
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.
Can we pls have a comment explaining this. Not obvious.
Might be good to have a PR description and/or comment to help introduce context |
Address common.Address | ||
} | ||
|
||
type LogAnswerUpdated struct { | ||
Current *big.Int | ||
RoundID *big.Int | ||
RoundId *big.Int | ||
Timestamp *big.Int |
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.
Maybe keep as RoundID?
https://github.com/golang/go/wiki/CodeReviewComments#initialisms
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.
No, that was the whole issue in the first place -- Geth's code expected a lowercase final d
Changes made and this is urgent
cedcd85
to
c1a35b7
Compare
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 just one tiny comment request
No description provided.