You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
eth_getBlockByNumber returns either transaction hashes or full transactions depending on the second boolean argument. For this we have Web3Client.getBlockInformation that also has an optional boolean argument which is sent but the transactions from the response are never parsed.
I need to parse them and so to add this functionality. We need to decide on Dart data structure because it is a bad practice to use List<dynamic> for this.
I suggest to:
Subclass BlockInformation with BlockInformationWithTransactions and BlockInformationWithTransactionHashes. The subclasses would have transactions field of corresponding list type. The base class would not have this field.
Add 2 methods to Web3Client: getBlockByNumberWithTransactions, getBlockByNumberWithTransactionHashes. They would return the corresponding block types. Their names are chosen to more closely match the RPC names. They would accept BlockNum as the first argument instead of String that getBlockInformation currently accepts, this is for consistency across other methods and for ease of calling.
Deprecate the existing getBlockInformation method.
I can do this myself. @simolus3 what do you think?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
eth_getBlockByNumber
returns either transaction hashes or full transactions depending on the second boolean argument. For this we haveWeb3Client.getBlockInformation
that also has an optional boolean argument which is sent but the transactions from the response are never parsed.I need to parse them and so to add this functionality. We need to decide on Dart data structure because it is a bad practice to use
List<dynamic>
for this.I suggest to:
Subclass
BlockInformation
withBlockInformationWithTransactions
andBlockInformationWithTransactionHashes
. The subclasses would havetransactions
field of corresponding list type. The base class would not have this field.Add 2 methods to Web3Client:
getBlockByNumberWithTransactions
,getBlockByNumberWithTransactionHashes
. They would return the corresponding block types. Their names are chosen to more closely match the RPC names. They would acceptBlockNum
as the first argument instead of String thatgetBlockInformation
currently accepts, this is for consistency across other methods and for ease of calling.Deprecate the existing
getBlockInformation
method.I can do this myself.
@simolus3 what do you think?
The text was updated successfully, but these errors were encountered: