-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Parse tuple arguments from event #2211
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixed issues with parsing tuples and nested tuples in event logs |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// This older version of the Emitter contract can be use to keep the strict bytes test against it while we work on | ||
// updating the strict bytes checking to be compatible with newer solidity versions. | ||
// # See: https://github.com/ethereum/web3.py/issues/2301 | ||
|
||
pragma solidity ^0.4.21; | ||
|
||
|
||
contract Emitter { | ||
event LogAnonymous() anonymous; | ||
event LogNoArguments(); | ||
event LogSingleArg(uint arg0); | ||
event LogDoubleArg(uint arg0, uint arg1); | ||
event LogTripleArg(uint arg0, uint arg1, uint arg2); | ||
event LogQuadrupleArg(uint arg0, uint arg1, uint arg2, uint arg3); | ||
event LogString(string v); | ||
event LogBytes(bytes v); | ||
|
||
// Indexed | ||
event LogSingleWithIndex(uint indexed arg0); | ||
event LogSingleAnonymous(uint indexed arg0) anonymous; | ||
event LogDoubleWithIndex(uint arg0, uint indexed arg1); | ||
event LogDoubleAnonymous(uint arg0, uint indexed arg1) anonymous; | ||
event LogTripleWithIndex(uint arg0, uint indexed arg1, uint indexed arg2); | ||
event LogQuadrupleWithIndex(uint arg0, uint arg1, uint indexed arg2, uint indexed arg3); | ||
event LogDynamicArgs(string indexed arg0, string arg1); | ||
event LogListArgs(bytes2[] indexed arg0, bytes2[] arg1); | ||
event LogAddressIndexed(address indexed arg0, address arg1); | ||
event LogAddressNotIndexed(address arg0, address arg1); | ||
|
||
enum WhichEvent { | ||
LogAnonymous, | ||
LogNoArguments, | ||
LogSingleArg, | ||
LogDoubleArg, | ||
LogTripleArg, | ||
LogQuadrupleArg, | ||
LogSingleAnonymous, | ||
LogSingleWithIndex, | ||
LogDoubleAnonymous, | ||
LogDoubleWithIndex, | ||
LogTripleWithIndex, | ||
LogQuadrupleWithIndex, | ||
LogBytes, | ||
LogString, | ||
LogDynamicArgs, | ||
LogListArgs, | ||
LogAddressIndexed, | ||
LogAddressNotIndexed | ||
} | ||
|
||
function logNoArgs(WhichEvent which) public { | ||
if (which == WhichEvent.LogNoArguments) emit LogNoArguments(); | ||
else if (which == WhichEvent.LogAnonymous) emit LogAnonymous(); | ||
else revert("Didn't match any allowable event index"); | ||
} | ||
|
||
function logSingle(WhichEvent which, uint arg0) public { | ||
if (which == WhichEvent.LogSingleArg) emit LogSingleArg(arg0); | ||
else if (which == WhichEvent.LogSingleWithIndex) emit LogSingleWithIndex(arg0); | ||
else if (which == WhichEvent.LogSingleAnonymous) emit LogSingleAnonymous(arg0); | ||
else revert("Didn't match any allowable event index"); | ||
} | ||
|
||
function logDouble(WhichEvent which, uint arg0, uint arg1) public { | ||
if (which == WhichEvent.LogDoubleArg) emit LogDoubleArg(arg0, arg1); | ||
else if (which == WhichEvent.LogDoubleWithIndex) emit LogDoubleWithIndex(arg0, arg1); | ||
else if (which == WhichEvent.LogDoubleAnonymous) emit LogDoubleAnonymous(arg0, arg1); | ||
else revert("Didn't match any allowable event index"); | ||
} | ||
|
||
function logTriple(WhichEvent which, uint arg0, uint arg1, uint arg2) public { | ||
if (which == WhichEvent.LogTripleArg) emit LogTripleArg(arg0, arg1, arg2); | ||
else if (which == WhichEvent.LogTripleWithIndex) emit LogTripleWithIndex(arg0, arg1, arg2); | ||
else revert("Didn't match any allowable event index"); | ||
} | ||
|
||
function logQuadruple(WhichEvent which, uint arg0, uint arg1, uint arg2, uint arg3) public { | ||
if (which == WhichEvent.LogQuadrupleArg) emit LogQuadrupleArg(arg0, arg1, arg2, arg3); | ||
else if (which == WhichEvent.LogQuadrupleWithIndex) emit LogQuadrupleWithIndex(arg0, arg1, arg2, arg3); | ||
else revert("Didn't match any allowable event index"); | ||
} | ||
|
||
function logDynamicArgs(string arg0, string arg1) public { | ||
emit LogDynamicArgs(arg0, arg1); | ||
} | ||
|
||
function logListArgs(bytes2[] arg0, bytes2[] arg1) public { | ||
emit LogListArgs(arg0, arg1); | ||
} | ||
|
||
function logAddressIndexedArgs(address arg0, address arg1) public { | ||
emit LogAddressIndexed(arg0, arg1); | ||
} | ||
|
||
function logAddressNotIndexedArgs(address arg0, address arg1) public { | ||
emit LogAddressNotIndexed(arg0, arg1); | ||
} | ||
|
||
function logBytes(bytes v) public { | ||
emit LogBytes(v); | ||
} | ||
|
||
function logString(string v) public { | ||
emit LogString(v); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.