Skip to content

Commit

Permalink
refactor(contracts-rfq): fix compiler warnings in tests (#3357)
Browse files Browse the repository at this point in the history
* refactor: shadowing, pure

* refactor: fix FastBridgeMock compiler warnings
  • Loading branch information
ChiTimesChi authored Nov 4, 2024
1 parent 5e11d4d commit 0dc9e1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/contracts-rfq/test/FastBridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ contract FastBridgeTest is Test {
internal
virtual
{
(uint96 timestamp, address relayer) = fastBridge.bridgeProofs(transactionId);
assertEq(timestamp, uint96(expectedTimestamp));
assertEq(relayer, expectedRelayer);
(uint96 proofTimestamp, address proofRelayer) = fastBridge.bridgeProofs(transactionId);
assertEq(proofTimestamp, uint96(expectedTimestamp));
assertEq(proofRelayer, expectedRelayer);
}

function _getBridgeRequestAndId(
Expand Down
16 changes: 9 additions & 7 deletions packages/contracts-rfq/test/FastBridgeMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ contract FastBridgeMock is IFastBridge, Admin {
}

function mockBridgeRequest(bytes32 transactionId, address sender, BridgeParams memory params) external {
sender;
uint256 originFeeAmount = (params.originAmount * protocolFeeRate) / FEE_BPS;
params.originAmount -= originFeeAmount;

Expand Down Expand Up @@ -73,6 +74,7 @@ contract FastBridgeMock is IFastBridge, Admin {
}

function mockBridgeRequestRaw(bytes32 transactionId, address sender, bytes memory request) external {
sender;
BridgeTransaction memory transaction = getBridgeTransaction(request);
emit BridgeRequested(
transactionId,
Expand Down Expand Up @@ -105,31 +107,31 @@ contract FastBridgeMock is IFastBridge, Admin {
);
}

function bridge(BridgeParams memory params) external payable {
function bridge(BridgeParams memory) external payable {
revert("not implemented");
}

function relay(bytes memory request) external payable {
function relay(bytes memory) external payable {
revert("not implemented");
}

function prove(bytes memory request, bytes32 destTxHash) external {
function prove(bytes memory, bytes32) external pure {
revert("not implemented");
}

function canClaim(bytes32 transactionid, address relayer) external view returns (bool) {
function canClaim(bytes32, address) external pure returns (bool) {
revert("not implemented");
}

function claim(bytes memory request, address to) external {
function claim(bytes memory, address) external pure {
revert("not implemented");
}

function dispute(bytes32 transactionId) external {
function dispute(bytes32) external pure {
revert("not implemented");
}

function refund(bytes memory request) external {
function refund(bytes memory) external pure {
revert("not implemented");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract FastBridgeMulticallTargetTest is MulticallTargetIntegrationTest {

function getEncodedBridgeTx(IFastBridge.BridgeTransaction memory bridgeTx)
public
view
pure
override
returns (bytes memory)
{
Expand Down

0 comments on commit 0dc9e1a

Please sign in to comment.