This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Allow decoder to use 4byte.directory to decode #6057
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dc754ce
Allow decoder to use 4byte.directory to decode (minus the actual sign…
haltman-at 0638572
Add code to actually get signatures from 4byte.directory
haltman-at 3208348
Add tests of selector-based decodings
haltman-at 9065237
Prevent infinite loops, apply strict mode, and ensure allocations are
haltman-at 81afc71
Account for constructors in decodeCalldata re-encoding check
haltman-at 2375271
Update comments
haltman-at 17fcdcf
Merge branch 'develop' into 4byte
haltman-at 29cd161
Add options for selector-based decoding and disable by default
haltman-at File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -979,7 +979,8 @@ export interface OverlargePointersNotImplementedError { | |
*/ | ||
export type InternalUseError = | ||
| OverlongArrayOrStringStrictModeError | ||
| InternalFunctionInABIError; | ||
| InternalFunctionInABIError | ||
| ReEncodingMismatchError; | ||
|
||
/** | ||
* Error for the stricter length check in strict mode | ||
|
@@ -1000,3 +1001,16 @@ export interface OverlongArrayOrStringStrictModeError { | |
export interface InternalFunctionInABIError { | ||
kind: "InternalFunctionInABIError"; | ||
} | ||
|
||
/** | ||
* This doesn't really belong here, but we need something for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe better to say "This isn't so much a Format error", rather than "here", since the docstring might not show up in the context you expect always There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, good point. |
||
* when re-encoding doesn't match and we're decoding a transaction | ||
* (since there we have to error instead of just skipping). | ||
* | ||
* @Category Internal-use errors | ||
*/ | ||
export interface ReEncodingMismatchError { | ||
kind: "ReEncodingMismatchError"; | ||
data: Uint8Array; | ||
reEncodedData: Uint8Array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think we need to document somewhere what this option does, since it kind of turns this function into something of a chimera. Like, how is it used for selector-based 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.
Hm. I mean all of this stuff doesn't really have documentation, as this is codec rather than decoder. But I can expand the comment to explain it better.