-
Notifications
You must be signed in to change notification settings - Fork 444
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
modified Block struct #873
base: develop
Are you sure you want to change the base?
Conversation
- modified to allow an optional type of 'totalDifficulty' - because 'totalDifficulty' was removed from Ethereum official Blockschema
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.
Looks good to me but this is a breaking change and we can only make it part of the v4 which I'm not sure when will be released.
If I make it target the develop-v4.0 branch than we have a problem:
What I suggest is that we keep the totalDifficulty: BigUInt
non optional and during decoding we provide a default value set to 0. We will add a comment alongside yours telling that 0 means this value is not defined and shall not be used.
Co-authored-by: Jenea Vranceanu <[email protected]>
Co-authored-by: Jenea Vranceanu <[email protected]>
Very Good Idea. |
a0218ff
to
8c152f5
Compare
modified to allow an optional type of 'totalDifficulty'
According to 'ethereum/execution-apis@9e16d5e', you can see that the 'totalDifficulty field was removed from the Blockschema on September 4.
Since the existing structure required a 'totalDifficulty' field, if the result of a json structure without a 'totalDifficulty' field is returned from the Ethereum node, there is an issue that decoding fails in the web3swift library. To solve this problem, the 'totalDifficulty' field was changed to an optional field.
Summary of Changes
modified 'totalDifficulty' to optional type in Block struct
By submitting this pull request, you are confirming the following:
develop
branch.