Skip to content

Commit 60d4e3b

Browse files
committed
refactor: improve import statements and test assertions in TrailsIntentEntrypoint tests
- Updated import statements to use the new syntax for better clarity and consistency. - Enhanced the token transfer test to assert success, ensuring that the transfer operation is validated. - Modified the constructor test to be a view function, reflecting its read-only nature.
1 parent 9a793fd commit 60d4e3b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/TrailsIntentEntrypoint.t.sol

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

4-
import "forge-std/Test.sol";
5-
import "../src/TrailsIntentEntrypoint.sol";
6-
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
7-
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
4+
import {Test} from "forge-std/Test.sol";
5+
import {TrailsIntentEntrypoint} from "../src/TrailsIntentEntrypoint.sol";
6+
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
7+
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
88

99
// Mock ERC20 token with permit functionality for testing
1010
contract MockERC20Permit is ERC20, ERC20Permit {
@@ -33,11 +33,11 @@ contract TrailsIntentEntrypointTest is Test {
3333
entrypoint = new TrailsIntentEntrypoint();
3434
token = new MockERC20Permit();
3535

36-
// Give user some tokens
37-
token.transfer(user, 1000 * 10 ** token.decimals());
36+
// Give user some tokens and check transfer success
37+
assertTrue(token.transfer(user, 1000 * 10 ** token.decimals()));
3838
}
3939

40-
function testConstructor() public {
40+
function testConstructor() public view {
4141
// Simple constructor test - just verify the contract was deployed
4242
assertTrue(address(entrypoint) != address(0));
4343
}

0 commit comments

Comments
 (0)