move events and nonce increment
This commit is contained in:
parent
7b179ec04c
commit
334f6754af
|
@ -452,7 +452,7 @@ contract Identity is ERC725, ERC735 {
|
|||
returns (uint256 executionId)
|
||||
{
|
||||
executionId = nonce;
|
||||
emit ExecutionRequested(executionId, _to, _value, _data);
|
||||
nonce++;
|
||||
txx[executionId] = Transaction({
|
||||
to: _to,
|
||||
value: _value,
|
||||
|
@ -460,7 +460,7 @@ contract Identity is ERC725, ERC735 {
|
|||
nonce: nonce,
|
||||
approverCount: 0
|
||||
});
|
||||
nonce++;
|
||||
emit ExecutionRequested(executionId, _to, _value, _data);
|
||||
}
|
||||
|
||||
function _approve(
|
||||
|
@ -477,8 +477,6 @@ contract Identity is ERC725, ERC735 {
|
|||
uint256 approvalCount;
|
||||
uint256 requiredKeyPurpose;
|
||||
|
||||
emit Approved(_id, _approval);
|
||||
|
||||
if (trx.to == address(this)) {
|
||||
require(isKeyPurpose(_key, MANAGEMENT_KEY));
|
||||
bytes32 managerKeyHash = keccak256(_key, MANAGEMENT_KEY);
|
||||
|
@ -491,6 +489,8 @@ contract Identity is ERC725, ERC735 {
|
|||
approvalCount = _calculateApprovals(actorKeyHash, _approval, trx);
|
||||
}
|
||||
|
||||
emit Approved(_id, _approval);
|
||||
|
||||
if (approvalCount >= minimumApprovalsByKeyPurpose[requiredKeyPurpose]) {
|
||||
//(?) success should be included in event?
|
||||
success = trx.to.call.value(trx.value)(trx.data);
|
||||
|
@ -514,9 +514,9 @@ contract Identity is ERC725, ERC735 {
|
|||
_purpose == CLAIM_SIGNER_KEY ||
|
||||
_purpose == ENCRYPTION_KEY
|
||||
);
|
||||
emit KeyAdded(_key, _purpose, _type);
|
||||
keys[keyHash] = Key(_purpose, _type, _key);
|
||||
indexes[keyHash] = keysByPurpose[_purpose].push(_key) - 1;
|
||||
emit KeyAdded(_key, _purpose, _type);
|
||||
}
|
||||
|
||||
function _removeKey(
|
||||
|
@ -526,8 +526,7 @@ contract Identity is ERC725, ERC735 {
|
|||
private
|
||||
{
|
||||
bytes32 keyHash = keccak256(_key, _purpose);
|
||||
Key storage myKey = keys[keyHash];
|
||||
emit KeyRemoved(myKey.key, myKey.purpose, myKey.keyType);
|
||||
Key memory myKey = keys[keyHash];
|
||||
|
||||
uint index = indexes[keyHash];
|
||||
delete indexes[keyHash];
|
||||
|
@ -545,6 +544,7 @@ contract Identity is ERC725, ERC735 {
|
|||
}
|
||||
|
||||
delete keys[keyHash];
|
||||
emit KeyRemoved(myKey.key, myKey.purpose, myKey.keyType);
|
||||
}
|
||||
|
||||
function _calculateApprovals(
|
||||
|
@ -615,6 +615,14 @@ contract Identity is ERC725, ERC735 {
|
|||
private
|
||||
{
|
||||
require(msg.sender == _issuer);
|
||||
claims[_claimHash] = Claim({
|
||||
claimType: _claimType,
|
||||
scheme: _scheme,
|
||||
issuer: _issuer,
|
||||
signature: _signature,
|
||||
data: _data,
|
||||
uri: _uri
|
||||
});
|
||||
emit ClaimChanged(
|
||||
_claimHash,
|
||||
_claimType,
|
||||
|
@ -624,14 +632,6 @@ contract Identity is ERC725, ERC735 {
|
|||
_data,
|
||||
_uri
|
||||
);
|
||||
claims[_claimHash] = Claim({
|
||||
claimType: _claimType,
|
||||
scheme: _scheme,
|
||||
issuer: _issuer,
|
||||
signature: _signature,
|
||||
data: _data,
|
||||
uri: _uri
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue