From 81bdf8d267a439f3181a02e199b84d80d014a77d Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 3 Apr 2024 19:55:06 +0200 Subject: [PATCH] Remove AcreBitcoinDepositorHarness contract We no longer need to define the test contract to expose internal functions so we remove it also from the deployment scripts. --- core/contracts/test/AcreBitcoinDepositorHarness.sol | 11 ----------- core/deploy/03_deploy_acre_bitcoin_depositor.ts | 4 ---- core/package.json | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/core/contracts/test/AcreBitcoinDepositorHarness.sol b/core/contracts/test/AcreBitcoinDepositorHarness.sol index e13a5e0bf..47f61d9d3 100644 --- a/core/contracts/test/AcreBitcoinDepositorHarness.sol +++ b/core/contracts/test/AcreBitcoinDepositorHarness.sol @@ -9,17 +9,6 @@ import {IBridgeTypes} from "@keep-network/tbtc-v2/contracts/integrator/IBridge.s import {TestERC20} from "./TestERC20.sol"; -/// @dev A test contract to expose internal function from AcreBitcoinDepositor contract. -/// This solution follows Foundry recommendation: -/// https://book.getfoundry.sh/tutorials/best-practices#internal-functions -contract AcreBitcoinDepositorHarness is AcreBitcoinDepositor { - function exposed_finalizeBridging( - uint256 depositKey - ) external returns (uint256 amountToStake, address staker) { - return finalizeBridging(depositKey); - } -} - /// @dev A test contract to stub tBTC Bridge contract. contract BridgeStub is MockBridge {} diff --git a/core/deploy/03_deploy_acre_bitcoin_depositor.ts b/core/deploy/03_deploy_acre_bitcoin_depositor.ts index 73df43e9c..f2063d5c1 100644 --- a/core/deploy/03_deploy_acre_bitcoin_depositor.ts +++ b/core/deploy/03_deploy_acre_bitcoin_depositor.ts @@ -15,10 +15,6 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { const [, acreBitcoinDepositorDeployment] = await helpers.upgrades.deployProxy( "AcreBitcoinDepositor", { - contractName: - process.env.HARDHAT_TEST === "true" - ? "AcreBitcoinDepositorHarness" - : "AcreBitcoinDepositor", factoryOpts: { signer: deployer, }, diff --git a/core/package.json b/core/package.json index 3a4cb303d..26ec0fa79 100644 --- a/core/package.json +++ b/core/package.json @@ -26,7 +26,7 @@ "lint:sol:fix": "solhint 'contracts/**/*.sol' --fix && prettier --write 'contracts/**/*.sol'", "lint:config": "prettier --check '**/*.@(json)'", "lint:config:fix": "prettier --write '**/*.@(json)'", - "test": "HARDHAT_TEST=true hardhat test" + "test": "hardhat test" }, "devDependencies": { "@keep-network/hardhat-helpers": "^0.7.1",