Now testing events in constructors! (#1511)

* Added inTransaction tests.

* Added expectEvent.inConstructor.

* Changed inTransaction, removed decodeLogs.

* Flipped comparison to improve the error message.

* Improved expectEvent tests.

* Migrated tests to use expectEvent.

* Added roles constructor tests.

* Fixed linter errors.

* Made lodash a dev dependency.

* Added more inLogs tests.

* Update expectEvent.test.js

* Removed lodash.

* Moved role constructor tests to public role behavior.

* Revert "Flipped comparison to improve the error message."

This reverts commit 438c57833d.

* Replaced chai-as-promised with shouldFail.
This commit is contained in:
Nicolás Venturo
2018-11-27 17:56:26 -03:00
committed by GitHub
parent f0e12d5301
commit c2de8ffd14
9 changed files with 218 additions and 49 deletions

View File

@ -11,6 +11,12 @@ contract EventEmitter {
event String(string value);
event LongUintBooleanString(uint256 uintValue, bool booleanValue, string stringValue);
constructor (uint8 uintValue, bool booleanValue, string stringValue) public {
emit ShortUint(uintValue);
emit Boolean(booleanValue);
emit String(stringValue);
}
function emitArgumentless() public {
emit Argumentless();
}
@ -51,4 +57,17 @@ contract EventEmitter {
emit LongUint(uintValue);
emit Boolean(boolValue);
}
function emitStringAndEmitIndirectly(string value, IndirectEventEmitter emitter) public {
emit String(value);
emitter.emitStringIndirectly(value);
}
}
contract IndirectEventEmitter {
event IndirectString(string value);
function emitStringIndirectly(string value) public {
emit IndirectString(value);
}
}