From 555887511a5fd19fc0ab4327909bf1363863bc6f Mon Sep 17 00:00:00 2001 From: cyhhao Date: Fri, 16 Dec 2022 14:44:24 +0800 Subject: [PATCH] change name --- contracts/Git3.sol | 10 +++++----- test/test-create.ts => scripts/create-repo.ts | 2 +- {test => scripts}/git3.png | Bin test/test-up.ts => scripts/upload-file.ts | 2 +- test/git3-test.js | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) rename test/test-create.ts => scripts/create-repo.ts (97%) rename {test => scripts}/git3.png (100%) rename test/test-up.ts => scripts/upload-file.ts (98%) diff --git a/contracts/Git3.sol b/contracts/Git3.sol index b6e586f..9d82702 100644 --- a/contracts/Git3.sol +++ b/contracts/Git3.sol @@ -6,7 +6,7 @@ import "./IFileOperator.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "git3-evm-large-storage/contracts/v2/LargeStorageManagerV2.sol"; -contract Git3 is LargeStorageManagerV2 { +contract Git3Hub is LargeStorageManagerV2 { struct refInfo { bytes20 hash; uint96 index; @@ -59,10 +59,10 @@ contract Git3 is LargeStorageManagerV2 { repoNameToOwner[repoName] = msg.sender; } - function transferOwnership(bytes memory repoName, address newOwner) - external - onlyOwner(repoName) - { + function transferOwnership( + bytes memory repoName, + address newOwner + ) external onlyOwner(repoName) { require(newOwner != address(0), "newOwner must not be zero address"); repoNameToOwner[repoName] = newOwner; } diff --git a/test/test-create.ts b/scripts/create-repo.ts similarity index 97% rename from test/test-create.ts rename to scripts/create-repo.ts index b41f408..55fe327 100644 --- a/test/test-create.ts +++ b/scripts/create-repo.ts @@ -7,7 +7,7 @@ async function main() { console.log(accounts[0].address); const Git3 = await hre.ethers.getContractAt( - "Git3", + "Git3Hub", "0x0068bD3ec8D16402690C1Eddff06ACb913A209ef" ); let rept diff --git a/test/git3.png b/scripts/git3.png similarity index 100% rename from test/git3.png rename to scripts/git3.png diff --git a/test/test-up.ts b/scripts/upload-file.ts similarity index 98% rename from test/test-up.ts rename to scripts/upload-file.ts index 8947447..e761d4c 100644 --- a/test/test-up.ts +++ b/scripts/upload-file.ts @@ -7,7 +7,7 @@ async function main() { console.log(accounts[0].address); const Git3 = await hre.ethers.getContractAt( - "Git3", + "Git3Hub", "0xa709975Bc01e745432f8898499E7b9a60f420117" ); diff --git a/test/git3-test.js b/test/git3-test.js index 8c6dc6e..51eba49 100644 --- a/test/git3-test.js +++ b/test/git3-test.js @@ -9,7 +9,7 @@ let ETH = ethers.BigNumber.from(10).pow(18); describe("Git3 Test", function () { it("upload/download/remove", async function () { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); await git3.deployed(); @@ -42,7 +42,7 @@ describe("Git3 Test", function () { }); it("upload/download/remove chunks", async function () { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); await git3.deployed(); @@ -76,7 +76,7 @@ describe("Git3 Test", function () { }); it("set/update/list/remove Reference", async function () { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); await git3.deployed(); @@ -125,7 +125,7 @@ describe("Git3 Test", function () { }); it("Access Control", async function () { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); await git3.deployed(); @@ -174,7 +174,7 @@ describe("Git3 Test", function () { }); it("RepoName Check", async function () { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); await git3.deployed(); @@ -194,7 +194,7 @@ describe("Git3 Test", function () { }); it("Get the stake number of chunks", async function () { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); await git3.deployed(); @@ -247,7 +247,7 @@ describe("Git3 Test", function () { }); it("Refund to user directly after removing chunk", async function () { - const Git3 = await ethers.getContractFactory("Git3"); + const Git3 = await ethers.getContractFactory("Git3Hub"); const git3 = await Git3.deploy(); await git3.deployed();