Skip to content

Commit 1220480

Browse files
Web faucet UI adjustments (#125)
* Simplify WebUI setup * Fix compillation errors * Further compillation cleanup * Attempt to fix failing CI * Uninstall fs as per the warning * Update useStore and .env.sample * Clean up * Re-add gitmodules for fix Netlify * Add netlify toml * Update Netlify config * Update env sample to use load-balanced RPC * Remove unused files
1 parent be3e6b6 commit 1220480

File tree

25 files changed

+2124
-3974
lines changed

25 files changed

+2124
-3974
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "smart_contract/lib/forge-std"]
2+
path = smart_contract/lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std.git

netlify.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build]
2+
base = "web-app"
3+
publish = ".next"
4+
command = "yarn install && yarn build"
5+
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF web-app .gitmodules"

smart_contract/contracts/test/Faucet.t.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
55
* @title Faucet - Test
66
*/
77

8-
import { CheatCodes } from 'foundry-test-utility/contracts/utils/cheatcodes.sol';
8+
// forge-std provides Vm via Test base; explicit CheatCodes import not needed
99
import { Constants } from "./utils/constants.t.sol";
1010

1111
import { Faucet } from "../Faucet.sol";
@@ -21,6 +21,10 @@ contract FaucetTest is Constants {
2121

2222
faucet.addMinter(address(this));
2323

24+
// Align contract config with test constants
25+
faucet.setWithdrawalAmount(BASIC_MINT_AMOUNT);
26+
faucet.setLockTime(BASIC_TIME_LOCK);
27+
2428
vm.deal(address(faucet), BASIC_MINT_AMOUNT);
2529

2630
vm.stopPrank();

smart_contract/contracts/test/utils/constants.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.0;
33

4-
import 'foundry-test-utility/contracts/utils/console.sol';
4+
import 'forge-std/console.sol';
55
import { Errors } from './errors.t.sol';
66

77
contract Constants is Errors {

smart_contract/contracts/test/utils/errors.t.sol

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.0;
33

4-
import { stdJson } from 'foundry-test-utility/contracts/utils/stdJson.sol';
5-
import { Vm } from 'foundry-test-utility/contracts/utils/vm.sol';
6-
import { DSTest } from 'foundry-test-utility/contracts/utils/test.sol';
4+
import { stdJson } from 'forge-std/StdJson.sol';
5+
import { Test } from 'forge-std/Test.sol';
76

8-
contract Errors is DSTest {
7+
contract Errors is Test {
98
using stdJson for string;
109

11-
Vm public constant vm = Vm(address(uint160(uint256(keccak256('hevm cheat code')))));
12-
1310
mapping(RevertStatus => string) private _errors;
1411

15-
// Add a revert error to the enum of errors.
1612
enum RevertStatus {
1713
SUCCESS,
1814
SKIP_VALIDATION,
@@ -25,7 +21,10 @@ contract Errors is DSTest {
2521

2622
// Associate your error with a revert message and add it to the mapping.
2723
constructor() {
28-
string memory json = vm.readFile('./constants/errors.json');
24+
// Resolve path from the Foundry project root to avoid CI working-directory issues
25+
string memory root = vm.projectRoot();
26+
string memory path = string.concat(root, '/constants/errors.json');
27+
string memory json = vm.readFile(path);
2928

3029
// Faucet
3130
_errors[RevertStatus.Faucet_FailSendingNativeToken] = json.readString('.Faucet.FailSendingNativeToken');

smart_contract/lib/forge-std

Submodule forge-std added at 8bbcf6e

0 commit comments

Comments
 (0)