Skip to content

Commit

Permalink
Attempt to fix linking libraries not working with deployCodeTo https:…
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Aug 22, 2024
1 parent 9fdfe14 commit 9418531
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma solidity >=0.5.13 <0.9.0;

interface IValidatorsMockFactory {
function deployValidatorsMock(bool test) external returns (address);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import "@celo-contracts-8/common/interfaces/IPrecompiles.sol";
import "@celo-contracts/governance/Election.sol";
import "@celo-contracts/governance/LockedGold.sol";
import "@celo-contracts/governance/interfaces/IValidators.sol";
// import "./ValidatorsMockFactory.sol";
import "@celo-contracts-8/governance/test/IValidatorsMock.sol";

import "@celo-contracts/stability/test/MockStableToken.sol";
import "@celo-contracts/governance/test/MockElection.sol";
Expand Down Expand Up @@ -169,8 +171,14 @@ contract ValidatorsTest is Test, TestConstants, Utils, ECDSAHelper {

lockedGold = new MockLockedGold();
election = new MockElection();
address validatorsAddress = actor("Validators");
deployCodeTo("ValidatorsMock.sol", validatorsAddress);
// address validatorsAddress = actor("Validators");
address validatorsMockFactoryAddress = actor("validatorsMockFactory");
deployCodeTo("ValidatorsMockFactory.sol", validatorsMockFactoryAddress);

address validatorsAddress = IValidatorsMockFactory(validatorsMockFactoryAddress)
.deployValidatorsMock(false);

// deployCodeTo("ValidatorsMock.sol", validatorsAddress);
validators = IValidators(validatorsAddress);
validatorsMockTunnel = new ValidatorsMockTunnel(address(validators));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.7 <0.8.20;

import "@celo-contracts-8/governance/test/ValidatorsMock.sol";
import "@celo-contracts-8/governance/test/IValidatorsMock.sol";

contract ValidatorsMockFactory {
function deployValidatorsMock(bool test) external returns (address) {
return address(new ValidatorsMock());
}
}

0 comments on commit 9418531

Please sign in to comment.