This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract EthereumClaimsRegistry { | |
mapping(address => mapping(address => mapping(bytes32 => bytes32))) public registry; | |
event ClaimSet( | |
address indexed issuer, | |
address indexed subject, | |
bytes32 indexed key, | |
bytes32 value, | |
uint updatedAt); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export var write = (ws, message) => | |
{ | |
if(message.hasOwnProperty('data')){ | |
var temp = JSON.parse(message.data); | |
if(temp.length == 1) | |
delete temp[0]['extraData']; | |
else{ | |
for(var i=1;i<temp.length;i++) | |
delete temp[i]['extraData']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var calculateHashForBlock = (block) => { | |
return calculateHash(block.index, block.previousHash, block.timestamp, block.data); | |
}; | |
var calculateHash = (index, previousHash, timestamp, data) => { | |
return CryptoJS.SHA256(index + previousHash + timestamp + data).toString(); | |
}; |
NewerOlder