add batch upload function

main
cyhhao 2 years ago
parent 7b498b35c1
commit 3c7423eabf

@ -64,6 +64,19 @@ contract Git3Hub_SLI is Git3HubStorage_SLI {
pathToHash[keccak256(bytes.concat(repoName, "/", path))] = data; pathToHash[keccak256(bytes.concat(repoName, "/", path))] = data;
} }
function batchUpload(
bytes memory repoName,
bytes[] memory path,
bytes[] calldata data
) external payable onlyOwner(repoName) {
require(path.length == data.length, "path and data length mismatch");
for (uint i = 0; i < path.length; i++) {
pathToHash[keccak256(bytes.concat(repoName, "/", path[i]))] = data[
i
];
}
}
function remove( function remove(
bytes memory repoName, bytes memory repoName,
bytes memory path bytes memory path

@ -16,7 +16,6 @@ async function main() {
type: 2, type: 2,
maxFeePerGas: price.maxFeePerGas!, maxFeePerGas: price.maxFeePerGas!,
maxPriorityFeePerGas: price.maxPriorityFeePerGas!, maxPriorityFeePerGas: price.maxPriorityFeePerGas!,
gasLimit: 3000000,
}); });
let logicReceipt = await git3.deployed(); let logicReceipt = await git3.deployed();

Loading…
Cancel
Save