add execution failed event

This commit is contained in:
Ricardo Guilherme Schmidt 2018-04-25 09:45:27 -03:00
parent 023eca0d5f
commit 0636efd8a7
2 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,7 @@ contract ERC725 {
event KeyRemoved(bytes32 indexed key, uint256 indexed purpose, uint256 indexed keyType);
event ExecutionRequested(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data);
event Executed(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data);
event ExecutionFailed(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data);
event Approved(uint256 indexed executionId, bool approved);
struct Key {

View File

@ -499,8 +499,11 @@ contract Identity is ERC725, ERC735 {
delete txx[_id];
//(?) success should be included in event?
success = address(trx.to).call.value(trx.value)(trx.data);
emit Executed(_id, trx.to, trx.value, trx.data);
if(success){
emit Executed(_id, trx.to, trx.value, trx.data);
} else {
emit ExecutionFailed(_id, trx.to, trx.value, trx.data));
}
}
}