diff --git a/configuration/networks/hardhat/configuration.js b/configuration/networks/hardhat/configuration.js index 8064363..809840a 100644 --- a/configuration/networks/hardhat/configuration.js +++ b/configuration/networks/hardhat/configuration.js @@ -3,6 +3,7 @@ module.exports = { repairRewardPercentage: 10, maxNumberOfSlashes: 2, slashPercentage: 20, + validatorRewardPercentage: 20, // percentage of the slashed amount going to the validators }, proofs: { // period has to be less than downtime * blocktime diff --git a/contracts/Requests.sol b/contracts/Requests.sol index 103320f..aca6ef4 100644 --- a/contracts/Requests.sol +++ b/contracts/Requests.sol @@ -23,7 +23,7 @@ struct Ask { } struct Content { - string cid; // content id, used to download the dataset + bytes cid; // content id, used to download the dataset bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs } diff --git a/test/Marketplace.test.js b/test/Marketplace.test.js index d6170b0..c890300 100644 --- a/test/Marketplace.test.js +++ b/test/Marketplace.test.js @@ -279,7 +279,7 @@ describe("Marketplace", function () { }) it("is rejected when cid is missing", async function () { - request.content.cid = "" + request.content.cid = [] await expect(marketplace.requestStorage(request)).to.be.revertedWith( "Marketplace_InvalidCid" ) diff --git a/test/examples.js b/test/examples.js index 4f27b3b..ba84e9a 100644 --- a/test/examples.js +++ b/test/examples.js @@ -34,7 +34,7 @@ const exampleRequest = async () => { collateralPerByte: 1, }, content: { - cid: "zb2rhheVmk3bLks5MgzTqyznLu1zqGH5jrfTA1eAZXrjx7Vob", + cid: Buffer.from("zb2rhheVmk3bLks5MgzTqyznLu1zqGH5jrfTA1eAZXrjx7Vob"), merkleRoot: Array.from(randomBytes(32)), }, expiry: hours(1), diff --git a/test/ids.js b/test/ids.js index af3dada..549daa1 100644 --- a/test/ids.js +++ b/test/ids.js @@ -3,7 +3,7 @@ const { keccak256, defaultAbiCoder } = ethers.utils function requestId(request) { const Ask = "tuple(int64, uint256, uint256, uint256, uint256, uint256, int64)" - const Content = "tuple(string, bytes32)" + const Content = "tuple(bytes, bytes32)" const Request = "tuple(address, " + Ask + ", " + Content + ", uint256, bytes32)" return keccak256(defaultAbiCoder.encode([Request], requestToArray(request)))