@digix/ipfs-pinning-registry
Advanced tools
Comparing version
@@ -6,15 +6,2 @@ { | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"name": "_hash", | ||
"type": "bytes32" | ||
} | ||
], | ||
"name": "removeHash", | ||
"outputs": [], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [], | ||
@@ -30,15 +17,2 @@ "name": "kill", | ||
{ | ||
"name": "_hash", | ||
"type": "bytes32" | ||
} | ||
], | ||
"name": "addHash", | ||
"outputs": [], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"name": "addr", | ||
@@ -89,12 +63,17 @@ "type": "address" | ||
{ | ||
"anonymous": false, | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"name": "_hash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"name": "_added", | ||
"type": "bool" | ||
} | ||
], | ||
"name": "AddHash", | ||
"type": "event" | ||
"name": "setHash", | ||
"outputs": [], | ||
"payable": false, | ||
"type": "function" | ||
}, | ||
@@ -108,9 +87,14 @@ { | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": false, | ||
"name": "_added", | ||
"type": "bool" | ||
} | ||
], | ||
"name": "RemoveHash", | ||
"name": "UpdateHash", | ||
"type": "event" | ||
} | ||
], | ||
"unlinked_binary": "0x606060405260008054600160a060020a03191633600160a060020a031617905534610000575b610296806100346000396000f3006060604052361561005c5763ffffffff60e060020a6000350416632ea2ee1b811461006157806341c0e1b51461007357806343e08ad1146100825780636f77926b146100945780637a57a984146100c15780638da5cb5b146100e1575b610000565b346100005761007160043561010a565b005b3461000057610071610169565b005b3461000057610071600435610195565b005b34610000576100ad600160a060020a03600435166101f4565b604080519115158252519081900360200190f35b3461000057610071600160a060020a03600435166024351515610216565b005b34610000576100ee61025b565b60408051600160a060020a039092168252519081900360200190f35b600160a060020a03331660009081526001602052604090205460ff16151561013157610000565b6040805182815290517f8a8acd36342131f72b9563c4071c8aa5836bec7791fbffefeacff6827b9e07c29181900360200190a15b5b50565b60005433600160a060020a0390811691161461018457610000565b600054600160a060020a0316ff5b5b565b600160a060020a03331660009081526001602052604090205460ff1615156101bc57610000565b6040805182815290517fb7cd723dd984c0b9631271db6b9567559b5375e02546364e524f506d185419189181900360200190a15b5b50565b600160a060020a03811660009081526001602052604090205460ff165b919050565b60005433600160a060020a0390811691161461023157610000565b600160a060020a0382166000908152600160205260409020805460ff19168215151790555b5b5050565b600054600160a060020a0316815600a165627a7a72305820e6c95817eedcb75b30a58b6543262dd845db219d0a4cad96a46684dacef5704d0029", | ||
"unlinked_binary": "0x606060405260008054600160a060020a03191633600160a060020a031617905534610000575b610227806100346000396000f300606060405263ffffffff60e060020a60003504166341c0e1b581146100505780636f77926b1461005f5780637a57a9841461008c5780638da5cb5b146100ac578063be225bb8146100d5575b610000565b346100005761005d6100ec565b005b3461000057610078600160a060020a0360043516610118565b604080519115158252519081900360200190f35b346100005761005d600160a060020a0360043516602435151561013a565b005b34610000576100b961017f565b60408051600160a060020a039092168252519081900360200190f35b346100005761005d600435602435151561018e565b005b60005433600160a060020a0390811691161461010757610000565b600054600160a060020a0316ff5b5b565b600160a060020a03811660009081526001602052604090205460ff165b919050565b60005433600160a060020a0390811691161461015557610000565b600160a060020a0382166000908152600160205260409020805460ff19168215151790555b5b5050565b600054600160a060020a031681565b600160a060020a03331660009081526001602081905260409091205460ff161515146101b957610000565b60408051838152821515602082015281517f8c9f9b461122e53375b45f186af7d73c75173ee8b7741a793521e2f2a1633f09929181900390910190a15b5b50505600a165627a7a7230582089d1af3710a91b38a0ccc57dbb86cf9157ab88ec59169851c4b9ed1f9719c5a10029", | ||
"networks": { | ||
@@ -142,11 +126,28 @@ "42": { | ||
"type": "event" | ||
}, | ||
"0x8c9f9b461122e53375b45f186af7d73c75173ee8b7741a793521e2f2a1633f09": { | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"name": "_hash", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": false, | ||
"name": "_added", | ||
"type": "bool" | ||
} | ||
], | ||
"name": "UpdateHash", | ||
"type": "event" | ||
} | ||
}, | ||
"links": {}, | ||
"address": "0x8c137146d2cec78ca8b58cc8658ba4430cae3e40", | ||
"updated_at": 1491654992847 | ||
"address": "0x721248efc5d8e9f61dfda0837e2e3cf2c67726ad", | ||
"updated_at": 1491661897306 | ||
} | ||
}, | ||
"schema_version": "0.0.5", | ||
"updated_at": 1491654992847 | ||
"updated_at": 1491661897306 | ||
} |
@@ -67,8 +67,8 @@ { | ||
"links": {}, | ||
"address": "0x904ec3dc00365deb97e4b23e4957b6d7c5d3ca60", | ||
"updated_at": 1491654992849 | ||
"address": "0x39cadc48e548f5c7979c848fe1ae65ecd9395221", | ||
"updated_at": 1491661897308 | ||
} | ||
}, | ||
"schema_version": "0.0.5", | ||
"updated_at": 1491654992849 | ||
"updated_at": 1491661897308 | ||
} |
{ | ||
"name": "@digix/ipfs-pinning-registry", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "IPFS Pinning Regsitry Contracts", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -47,3 +47,3 @@ var HashLogger = artifacts.require("./HashLogger.sol"); | ||
}); | ||
it("should allow registered addreses to trigger AddHash event", function() { | ||
it("should allow registered addreses set true and trigger UpdatedHash event", function() { | ||
let registry; | ||
@@ -53,4 +53,4 @@ let event; | ||
registry = instance; | ||
event = instance.AddHash((err, result) => assert.equal(result.args._hash, exampleHash)); | ||
return registry.addHash(exampleHash, { from: accounts[1] }); | ||
event = instance.UpdateHash((err, result) => assert.equal(result.args._hash, exampleHash)); | ||
return registry.setHash(exampleHash, true, { from: accounts[1] }); | ||
}).then(() => { | ||
@@ -60,3 +60,3 @@ event.stopWatching(); | ||
}); | ||
it("should allow registered addreses to trigger RemoveHash event", function() { | ||
it("should allow registered addreses to set false and trigger UpdatedHash event", function() { | ||
let registry; | ||
@@ -66,4 +66,4 @@ let event; | ||
registry = instance; | ||
event = instance.RemoveHash((err, result) => assert.equal(result.args._hash, exampleHash)); | ||
return registry.removeHash(exampleHash, { from: accounts[1] }); | ||
event = instance.UpdateHash((err, result) => assert.equal(result.args._hash, exampleHash)); | ||
return registry.setHash(exampleHash, false, { from: accounts[1] }); | ||
}).then(() => { | ||
@@ -73,7 +73,7 @@ event.stopWatching(); | ||
}); | ||
it("should throw when non-user tries to addHash", function() { | ||
it("should throw when non-user tries to update hash", function() { | ||
let registry; | ||
return HashLogger.deployed().then(function(instance) { | ||
registry = instance; | ||
return registry.addHash(exampleHash, { from: accounts[2] }) | ||
return registry.setHash(exampleHash, true, { from: accounts[2] }) | ||
}).then((res) => { | ||
@@ -85,13 +85,2 @@ assert.ifError(res); | ||
}); | ||
it("should throw when non-user tries to removeHash", function() { | ||
let registry; | ||
return HashLogger.deployed().then(function(instance) { | ||
registry = instance; | ||
return registry.removeHash(exampleHash, { from: accounts[2] }) | ||
}).then((res) => { | ||
assert.ifError(res); | ||
}).catch((err) => { | ||
assert(err); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
11893
-3.23%333
-3.2%