Skip to content

Commit

Permalink
Merge pull request #72 from jwcheon/main
Browse files Browse the repository at this point in the history
Update file type typos & code spacings
  • Loading branch information
scott-klaytn authored Aug 25, 2024
2 parents a988d6f + 904abda commit 4baa83e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 76 deletions.
35 changes: 16 additions & 19 deletions docs/build/get-started/hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ In this section, we would be testing some of our contract functionalities.
**Step 2**: Copy the code below in the `sbtTest.js` file.

```js
// This is an example test file. Hardhat will run every *.ts file in `test/`,
// This is an example test file. Hardhat will run every *.js file in `test/`,
// so feel free to add new ones.

// Hardhat tests are normally written with Mocha and Chai.
Expand Down Expand Up @@ -259,26 +259,23 @@ describe("Token contract", function () {
await expect(
sbtContract.transferFrom(owner.address, addr1.address, 0)
).to.be.reverted;
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

});
const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});
})
```

Expand All @@ -292,7 +289,7 @@ The tests above check the following:
**Step 3**: To run your test, run the command below:

```bash
npx hardhat test test/sbtTest.ts
npx hardhat test test/sbtTest.js
```

![](/img/build/get-started/sbtTest.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ In this section, we would be testing some of our contract functionalities.
**Step 2**: Copy the code below in the `sbtTest.js` file.

```js
// This is an example test file. Hardhat will run every *.ts file in `test/`,
// This is an example test file. Hardhat will run every *.js file in `test/`,
// so feel free to add new ones.

// Hardhat tests are normally written with Mocha and Chai.
Expand Down Expand Up @@ -260,26 +260,23 @@ describe("Token contract", function () {
await expect(
sbtContract.transferFrom(owner.address, addr1.address, 0)
).to.be.reverted;
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

});
const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});
})
```

Expand All @@ -293,7 +290,7 @@ The tests above check the following:
**Step 3**: To run your test, run the command below:

```bash
npx hardhat test test/sbtTest.ts
npx hardhat test test/sbtTest.js
```

![](/img/build/get-started/sbtTest.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ contract SoulBoundToken is KIP17, Ownable {
**2단계**: 아래 코드를 `sbtTest.js` 파일에 복사합니다.

```js
// This is an example test file. Hardhat will run every *.ts file in `test/`,
// This is an example test file. Hardhat will run every *.js file in `test/`,
// so feel free to add new ones.

// Hardhat tests are normally written with Mocha and Chai.
Expand Down Expand Up @@ -260,26 +260,23 @@ describe("Token contract", function () {
await expect(
sbtContract.transferFrom(owner.address, addr1.address, 0)
).to.be.reverted;
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

});
const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});
})
```

Expand All @@ -293,7 +290,7 @@ describe("Token contract", function () {
**3단계**: 테스트를 실행하려면 아래 명령을 실행합니다:

```bash
npx hardhat test test/sbtTest.ts
npx hardhat test test/sbtTest.js
```

![](/img/build/get-started/sbtTest.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ In this section, we would be testing some of our contract functionalities.
**Step 2**: Copy the code below in the `sbtTest.js` file.

```js
// This is an example test file. Hardhat will run every *.ts file in `test/`,
// This is an example test file. Hardhat will run every *.js file in `test/`,
// so feel free to add new ones.

// Hardhat tests are normally written with Mocha and Chai.
Expand Down Expand Up @@ -260,26 +260,23 @@ describe("Token contract", function () {
await expect(
sbtContract.transferFrom(owner.address, addr1.address, 0)
).to.be.reverted;
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});

it("Should prohibit token transfer using safeTransferFrom", async function () {
const { sbtContract, owner, addr1 } = await loadFixture(
deployTokenFixture
);

});
const safemintTx = await sbtContract.safeMint(owner.address);

// prohibit token transfer of token id (0) from owner to addr1
await expect(sbtContract['safeTransferFrom(address,address,uint256)'](
owner.address,
addr1.address,
0
)).to.be.reverted;
});
});
})
```

Expand All @@ -293,7 +290,7 @@ The tests above check the following:
**Step 3**: To run your test, run the command below:

```bash
npx hardhat test test/sbtTest.ts
npx hardhat test test/sbtTest.js
```

![](/img/build/get-started/sbtTest.png)
Expand Down

0 comments on commit 4baa83e

Please sign in to comment.