Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Decode raw solidity test event logs #90

Merged
merged 1 commit into from
Jan 16, 2018
Merged

Conversation

cgewecke
Copy link
Contributor

@cgewecke cgewecke commented Jan 13, 2018

Addresses truffle 745, where a third-party assertions library modeled on Assert.sol has been written and is being used exclusive of Assert.sol. There's no convenient way to link it to the test contracts and expose its TestEvent on their ABI. As a result, only the transaction receipt's raw logs are available and test failures aren't being processed correctly.

This PR adds a manual decoding step to the test evaluation step when a) the result.logs are empty and b) result.receipt.logs are not empty. It assumes the third party library will use a TestEvent function signature identical to the one in Assert.sol.

Needs tests but those will be over in the truffle repo.

@cgewecke cgewecke requested a review from gnidan January 16, 2018 02:54
Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

N.B. that SolidityCoder appears to be going away with web3.js 1.0, but this is already used elsewhere, so this PR doesn't introduce any additional problems.

@gnidan gnidan merged commit 02d00cc into develop Jan 16, 2018
@gnidan gnidan deleted the decode-raw-test-logs branch January 16, 2018 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants