Skip to content

Commit

Permalink
feat: added tests on l2RewardManager
Browse files Browse the repository at this point in the history
  • Loading branch information
ksatyarth2 committed Jul 22, 2024
1 parent 2724ba4 commit 15fce8b
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 0 deletions.
1 change: 1 addition & 0 deletions mainnet-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"url": "https://puffer.fi"
},
"dependencies": {
"@connext/interfaces": "^2.0.5",
"@openzeppelin/contracts": "5.0.1",
"@openzeppelin/contracts-upgradeable": "5.0.1",
"eigenlayer-contracts": "https://github.com/Layr-Labs/eigenlayer-contracts.git#1bf4c12",
Expand Down
29 changes: 29 additions & 0 deletions mainnet-contracts/test/mocks/BridgeMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;

import { IXReceiver } from "interfaces/core/IXReceiver.sol";
import {L2RewardManager} from "../../src/l2-contracts/L2RewardManager.sol";
import "forge-std/Test.sol";

contract MockBridge {
function xcall(
uint32 _destination,
address _to,
address _asset,
address _delegate,
uint256 _amount,
uint256,
bytes calldata _callData
) external payable returns (bytes32) {
L2RewardManager(_to).xReceive(
keccak256(abi.encodePacked(_to, uint128(_amount), _asset, _delegate, _callData)), // transferId
uint128(_amount),
_asset,
msg.sender,
_destination,
_callData
);
console.log("rewardAmount: ", uint128(_amount));
return keccak256(abi.encodePacked(uint128(_amount)));
}
}
Loading

0 comments on commit 15fce8b

Please sign in to comment.