diff --git a/contracts/Git3.sol b/contracts/Git3.sol index 60c825f..3dbe9b6 100644 --- a/contracts/Git3.sol +++ b/contracts/Git3.sol @@ -98,7 +98,7 @@ contract Git3 is LargeStorageManagerV2 { bytes memory repoName, bytes memory path, bytes calldata data - ) public payable onlyOwner(repoName) { + ) external payable onlyOwner(repoName) { _putChunkFromCalldata( keccak256(bytes.concat(repoName, "/", path)), 0, @@ -112,7 +112,7 @@ contract Git3 is LargeStorageManagerV2 { bytes memory path, uint256 chunkId, bytes calldata data - ) public payable onlyOwner(repoName) { + ) external payable onlyOwner(repoName) { _putChunkFromCalldata( keccak256(bytes.concat(repoName, "/", path)), chunkId, @@ -124,7 +124,7 @@ contract Git3 is LargeStorageManagerV2 { function remove( bytes memory repoName, bytes memory path - ) public onlyOwner(repoName) { + ) external onlyOwner(repoName) { // The actually process of remove will remove all the chunks _remove(keccak256(bytes.concat(repoName, "/", path)), 0); } @@ -133,7 +133,7 @@ contract Git3 is LargeStorageManagerV2 { bytes memory repoName, bytes memory path, uint256 chunkId - ) public onlyOwner(repoName) { + ) external onlyOwner(repoName) { _removeChunk(keccak256(bytes.concat(repoName, "/", path)), chunkId); } @@ -153,7 +153,7 @@ contract Git3 is LargeStorageManagerV2 { function listRefs( bytes memory repoName - ) public view returns (refData[] memory list) { + ) external view returns (refData[] memory list) { list = new refData[](repoNameToRefs[repoName].length); for (uint index = 0; index < repoNameToRefs[repoName].length; index++) { list[index] = _convertRefInfo( @@ -167,7 +167,7 @@ contract Git3 is LargeStorageManagerV2 { bytes memory repoName, bytes memory name, bytes20 refHash - ) public onlyOwner(repoName) { + ) external onlyOwner(repoName) { bytes memory fullName = bytes.concat(repoName, "/", name); // only execute `sload` once to reduce gas consumption refInfo memory srs; @@ -194,7 +194,7 @@ contract Git3 is LargeStorageManagerV2 { function delRef( bytes memory repoName, bytes memory name - ) public onlyOwner(repoName) { + ) external onlyOwner(repoName) { bytes memory fullName = bytes.concat(repoName, "/", name); // only execute `sload` once to reduce gas consumption refInfo memory srs; diff --git a/test/git3-test.js b/test/git3-test.js index 4529c72..2931dae 100644 --- a/test/git3-test.js +++ b/test/git3-test.js @@ -270,7 +270,6 @@ describe("Git3 Test", function () { // check that the stake numer of chunk after removing chunks let balBefore = await signer.getBalance(); - console.log("balBefore:", balBefore); let tx1 = await git3.removeChunk(repoName, "0x616263", 0); // should succeed let rec1 = await tx1.wait(); let removeTxCost = rec1.gasUsed.mul(rec1.effectiveGasPrice);