Skip to content

Commit

Permalink
test: add case for EOA origin token
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Oct 22, 2024
1 parent 3ed1ee9 commit 3a211e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/contracts-rfq/test/FastBridgeV2.Src.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.20;

import {BridgeTransactionV2Lib} from "../contracts/libs/BridgeTransactionV2.sol";
import {TokenNotContract} from "../contracts/libs/Errors.sol";

import {FastBridgeV2SrcBaseTest, IFastBridge, IFastBridgeV2} from "./FastBridgeV2.Src.Base.t.sol";

Expand Down Expand Up @@ -254,6 +255,12 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {
bridge({caller: userA, msgValue: 0, params: tokenParams});
}

function test_bridge_revert_originTokenNotContract() public {
tokenParams.originToken = makeAddr("Random EOA");
vm.expectRevert(TokenNotContract.selector);
bridge({caller: userA, msgValue: 0, params: tokenParams});
}

function test_bridge_revert_deadlineTooClose() public {
tokenParams.deadline = block.timestamp + MIN_DEADLINE - 1;
vm.expectRevert(DeadlineTooShort.selector);
Expand Down

0 comments on commit 3a211e6

Please sign in to comment.