From 8f6683bf8d77bb821050e6b6d6c89b8375cdaf2f Mon Sep 17 00:00:00 2001 From: Arora Date: Mon, 18 Sep 2017 13:07:24 +0530 Subject: [PATCH] BugFix Issue #15: acceptEndorsement now returns a value --- contracts/SmartIdentity.sol | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contracts/SmartIdentity.sol b/contracts/SmartIdentity.sol index b2e0510..19fc9db 100644 --- a/contracts/SmartIdentity.sol +++ b/contracts/SmartIdentity.sol @@ -217,9 +217,18 @@ contract SmartIdentity { */ function acceptEndorsement(bytes32 _attributeHash, bytes32 _endorsementHash) onlyBy(owner) returns(bool) { var attribute = attributes[_attributeHash]; + if (attribute.hash != _attributeHash){ + sendEvent(ERROR_EVENT, "Attribute doesn't exist"); + revert(); + } var endorsement = attribute.endorsements[_endorsementHash]; + if (endorsement.hash != _endorsementHash){ + sendEvent(ERROR_EVENT, "Endorsement does not exist"); + revert(); + } endorsement.accepted = true; sendEvent(SIG_CHANGE_EVENT, "Endorsement has been accepted"); + return true; } /**