Skip to content

Commit fbcb004

Browse files
committed
Rename wrapper to Hsc
Signed-off-by: Luis Mastrangelo <luis@swirldslabs.com>
1 parent 3196a1e commit fbcb004

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ This is necessary because
7070
> - On Windows, it uses `Invoke-WebRequest` and `Start-Process` in PowerShell for a similar effect.
7171
7272
To activate HTS emulation in your tests, you need to add the following setup code in your test files.
73-
Import our wrapper `library` to deploy HTS emulation and enable cheat codes for it.
73+
Import our System Contracts `library` to deploy HTS emulation and enable cheat codes for it.
7474

7575
```solidity
76-
import {HtsSetup} from "hedera-forking/HtsSetup.sol";
76+
import {Hsc} from "hedera-forking/Hsc.sol";
7777
```
7878

7979
and then invoke it in your [test setup](https://book.getfoundry.sh/forge/writing-tests)
8080

8181
```solidity
8282
function setUp() public {
83-
HtsSetup.htsSetup();
83+
Hsc.htsSetup();
8484
}
8585
```
8686

@@ -94,7 +94,7 @@ For example
9494
pragma solidity ^0.8.0;
9595
9696
import {Test} from "forge-std/Test.sol";
97-
import {HtsSetup} from "hedera-forking/HtsSetup.sol";
97+
import {Hsc} from "hedera-forking/Hsc.sol";
9898
import {IERC20} from "hedera-forking/IERC20.sol";
9999
import {IHederaTokenService} from "hedera-forking/IHederaTokenService.sol";
100100
import {HederaResponseCodes} from "hedera-forking/HederaResponseCodes.sol";
@@ -106,7 +106,7 @@ contract USDCExampleTest is Test {
106106
address private user1;
107107
108108
function setUp() external {
109-
HtsSetup.htsSetup();
109+
Hsc.htsSetup();
110110
111111
user1 = makeAddr("user1");
112112
deal(USDC_mainnet, user1, 1000 * 10e8);
@@ -153,12 +153,12 @@ You can use all the tools and cheatcodes Foundry provides, _e.g._, `console.log`
153153
pragma solidity ^0.8.0;
154154
155155
import {Test, console} from "forge-std/Test.sol";
156-
import {HtsSetup} from "hedera-forking/HtsSetup.sol";
156+
import {Hsc} from "hedera-forking/Hsc.sol";
157157
import {IERC20} from "hedera-forking/IERC20.sol";
158158
159159
contract USDCConsoleExampleTest is Test {
160160
function setUp() external {
161-
HtsSetup.htsSetup();
161+
Hsc.htsSetup();
162162
}
163163
164164
function test_using_console_log() view external {
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {HtsSystemContractJson, HTS_ADDRESS} from "./HtsSystemContractJson.sol";
77
import {MirrorNode} from "./MirrorNode.sol";
88
import {MirrorNodeFFI} from "./MirrorNodeFFI.sol";
99

10-
library HtsSetup {
10+
/**
11+
* Library to deploy and setup System Contracts.
12+
*/
13+
library Hsc {
1114
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
1215

1316
/**

examples/foundry-hts/test/NFT.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.0;
33

44
import {Test, console} from "forge-std/Test.sol";
5-
import {HtsSetup} from "hedera-forking/HtsSetup.sol";
5+
import {Hsc} from "hedera-forking/Hsc.sol";
66
import {IERC721} from "hedera-forking/IERC721.sol";
77

88
contract NFTExampleTest is Test {
@@ -12,7 +12,7 @@ contract NFTExampleTest is Test {
1212
address private user;
1313

1414
function setUp() external {
15-
HtsSetup.htsSetup();
15+
Hsc.htsSetup();
1616

1717
user = makeAddr("user");
1818
dealERC721(NFT_mainnet, user, 3);

examples/foundry-hts/test/USDC.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.0;
33

44
import {Test} from "forge-std/Test.sol";
5-
import {HtsSetup} from "hedera-forking/HtsSetup.sol";
5+
import {Hsc} from "hedera-forking/Hsc.sol";
66
import {IERC20} from "hedera-forking/IERC20.sol";
77
import {IHederaTokenService} from "hedera-forking/IHederaTokenService.sol";
88
import {HederaResponseCodes} from "hedera-forking/HederaResponseCodes.sol";
@@ -14,7 +14,7 @@ contract USDCExampleTest is Test {
1414
address private user1;
1515

1616
function setUp() external {
17-
HtsSetup.htsSetup();
17+
Hsc.htsSetup();
1818

1919
user1 = makeAddr("user1");
2020
deal(USDC_mainnet, user1, 1000 * 10e8);

examples/foundry-hts/test/USDCConsole.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
pragma solidity ^0.8.0;
33

44
import {Test, console} from "forge-std/Test.sol";
5-
import {HtsSetup} from "hedera-forking/HtsSetup.sol";
5+
import {Hsc} from "hedera-forking/Hsc.sol";
66
import {IERC20} from "hedera-forking/IERC20.sol";
77

88
contract USDCConsoleExampleTest is Test {
99
function setUp() external {
10-
HtsSetup.htsSetup();
10+
Hsc.htsSetup();
1111
}
1212

1313
function test_using_console_log() view external {

test/lib/TestSetup.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.0;
33

44
import {console} from "forge-std/console.sol";
55

6-
import {HtsSetup} from "../../contracts/HtsSetup.sol";
6+
import {Hsc} from "../../contracts/Hsc.sol";
77
import {HTS_ADDRESS} from "../../contracts/HtsSystemContractJson.sol";
88
import {MirrorNode} from "../../contracts/MirrorNode.sol";
99
import {MirrorNodeFFI} from "../../contracts/MirrorNodeFFI.sol";
@@ -79,12 +79,12 @@ abstract contract TestSetup {
7979
mirrorNodeMock.deployHIP719Proxy(CTCF, "CTCF");
8080
mirrorNodeMock.deployHIP719Proxy(CFNFTFF, "CFNFTFF");
8181
mirrorNode = mirrorNodeMock;
82-
HtsSetup.htsSetup(mirrorNode);
82+
Hsc.htsSetup(mirrorNode);
8383
testMode = TestMode.NonFork;
8484
} else if (HTS_ADDRESS.code.length == 1) {
8585
console.log("HTS code length is 1, forking from a remote Hedera network, HTS/FFI code with Mirror Node backend is deployed here");
8686
mirrorNode = new MirrorNodeFFI();
87-
HtsSetup.htsSetup(mirrorNode);
87+
Hsc.htsSetup(mirrorNode);
8888
testMode = TestMode.FFI;
8989
} else {
9090
console.log("HTS code length is greater than 1 (%d), HTS code comes from forked network", HTS_ADDRESS.code.length);

0 commit comments

Comments
 (0)