Skip to content

Commit

Permalink
feat: spoelia fork testing
Browse files Browse the repository at this point in the history
  • Loading branch information
scolear committed Nov 26, 2024
1 parent 8930a86 commit 575807a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SEPOLIA_RPC_URL=
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ tab_width = 4

[rpc_endpoints] # test on local anvil which forked sepolia
default = "http://127.0.0.1:8545"
sepolia = "${SEPOLIA_RPC_URL}"
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
7 changes: 5 additions & 2 deletions test/iBTC_NetworkMiddleware.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {IVaultConfigurator} from "core/src/interfaces/IVaultConfigurator.sol";
import {IRegistry} from "core/src/interfaces/common/IRegistry.sol";

contract iBTC_NetworkMiddlewareTest is Test {
uint256 sepoliaFork;
string SEPOLIA_RPC_URL = vm.envString("SEPOLIA_RPC_URL");
address constant NETWORKMIDDLEWARESERVICE = 0x62a1ddfD86b4c1636759d9286D3A0EC722D086e3;
address constant NETWORKREGISTRY = 0x7d03b7343BF8d5cEC7C0C27ecE084a20113D15C9;
address constant OPERATOR_REGISTRY = 0x6F75a4ffF97326A00e52662d82EA4FdE86a2C548;
Expand Down Expand Up @@ -47,6 +49,7 @@ contract iBTC_NetworkMiddlewareTest is Test {
iBTC_Vault public iBTC_vault;

function setUp() public {
sepoliaFork = vm.createSelectFork(SEPOLIA_RPC_URL);
address[] memory whitelistedDepositors;

uint256 depositLimit = 1e10;
Expand Down Expand Up @@ -147,8 +150,8 @@ contract iBTC_NetworkMiddlewareTest is Test {
console.log("Slasher: ", slasher_);

vm.startPrank(address(iBTC_middleware));
NetworkRegistry(0x7d03b7343BF8d5cEC7C0C27ecE084a20113D15C9).registerNetwork();
NetworkMiddlewareService(0x62a1ddfD86b4c1636759d9286D3A0EC722D086e3).setMiddleware(address(iBTC_middleware));
NetworkRegistry(NETWORKREGISTRY).registerNetwork();
NetworkMiddlewareService(NETWORKMIDDLEWARESERVICE).setMiddleware(address(iBTC_middleware));
vm.stopPrank();
}

Expand Down

0 comments on commit 575807a

Please sign in to comment.