From 08a3fbb12b0fc4623a76e7db00b87b0e2b4f23a6 Mon Sep 17 00:00:00 2001 From: Eric Mastro Date: Wed, 17 Aug 2022 15:24:19 +1000 Subject: [PATCH] [chore] clean up bytes32 parameters Change the names of some bytes32 parameters to `slotId` and `requestId` to avoid confusion. --- contracts/Marketplace.sol | 4 ++-- contracts/Storage.sol | 40 +++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/contracts/Marketplace.sol b/contracts/Marketplace.sol index cbd7b6e..7fff085 100644 --- a/contracts/Marketplace.sol +++ b/contracts/Marketplace.sol @@ -108,8 +108,8 @@ contract Marketplace is Collateral, Proofs { return _timeout(); } - function proofEnd(bytes32 contractId) public view returns (uint256) { - return _end(contractId); + function proofEnd(bytes32 slotId) public view returns (uint256) { + return _end(slotId); } function price(Request calldata request) private pure returns (uint256) { diff --git a/contracts/Storage.sol b/contracts/Storage.sol index ebde0f9..65600da 100644 --- a/contracts/Storage.sol +++ b/contracts/Storage.sol @@ -32,42 +32,42 @@ contract Storage is Collateral, Marketplace { slashPercentage = _slashPercentage; } - function getRequest(bytes32 id) public view returns (Request memory) { - return _request(id); + function getRequest(bytes32 requestId) public view returns (Request memory) { + return _request(requestId); } - function getHost(bytes32 id) public view returns (address) { - return _host(id); + function getHost(bytes32 requestId) public view returns (address) { + return _host(requestId); } - function missingProofs(bytes32 contractId) public view returns (uint256) { - return _missed(contractId); + function missingProofs(bytes32 slotId) public view returns (uint256) { + return _missed(slotId); } - function isProofRequired(bytes32 contractId) public view returns (bool) { - return _isProofRequired(contractId); + function isProofRequired(bytes32 slotId) public view returns (bool) { + return _isProofRequired(slotId); } - function willProofBeRequired(bytes32 contractId) public view returns (bool) { - return _willProofBeRequired(contractId); + function willProofBeRequired(bytes32 slotId) public view returns (bool) { + return _willProofBeRequired(slotId); } - function getChallenge(bytes32 contractId) public view returns (bytes32) { - return _getChallenge(contractId); + function getChallenge(bytes32 slotId) public view returns (bytes32) { + return _getChallenge(slotId); } - function getPointer(bytes32 id) public view returns (uint8) { - return _getPointer(id); + function getPointer(bytes32 slotId) public view returns (uint8) { + return _getPointer(slotId); } - function submitProof(bytes32 contractId, bytes calldata proof) public { - _submitProof(contractId, proof); + function submitProof(bytes32 slotId, bytes calldata proof) public { + _submitProof(slotId, proof); } - function markProofAsMissing(bytes32 contractId, uint256 period) public { - _markProofAsMissing(contractId, period); - if (_missed(contractId) % slashMisses == 0) { - _slash(_host(contractId), slashPercentage); + function markProofAsMissing(bytes32 slotId, uint256 period) public { + _markProofAsMissing(slotId, period); + if (_missed(slotId) % slashMisses == 0) { + _slash(_host(slotId), slashPercentage); } } }