Skip to content

Commit

Permalink
fix: json writing no longer occurs on live test
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonCase committed Sep 19, 2024
1 parent c34facf commit 7b22afa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions script/deploy/deployAll.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,19 @@ contract DeployAll is BaseScript {

ConfigReader.Config mainConfig;

// skips the json writing
function runLiveTest(string memory deployFile) public {
deploy(ConfigReader.toConfig(vm.readFile(string.concat(CONFIG_PATH_ROOT, deployFile)), getChainConfigFile()));
}

function run(string memory deployFile) public {
deploy(ConfigReader.toConfig(vm.readFile(string.concat(CONFIG_PATH_ROOT, deployFile)), getChainConfigFile()));
// write everything to an out file
mainConfig.boringVault.toHexString().write(OUTPUT_JSON_PATH, ".boringVault");
mainConfig.manager.toHexString().write(OUTPUT_JSON_PATH, ".manager");
mainConfig.accountant.toHexString().write(OUTPUT_JSON_PATH, ".accountant");
mainConfig.teller.toHexString().write(OUTPUT_JSON_PATH, ".teller");
mainConfig.rolesAuthority.toHexString().write(OUTPUT_JSON_PATH, ".rolesAuthority");
}

function deploy(ConfigReader.Config memory config) public override returns (address) {
Expand Down Expand Up @@ -84,13 +95,6 @@ contract DeployAll is BaseScript {
console.log("Set Authority And Transfer Ownerships Complete");

mainConfig = config;

// write everything to an out file
config.boringVault.toHexString().write(OUTPUT_JSON_PATH, ".boringVault");
config.manager.toHexString().write(OUTPUT_JSON_PATH, ".manager");
config.accountant.toHexString().write(OUTPUT_JSON_PATH, ".accountant");
config.teller.toHexString().write(OUTPUT_JSON_PATH, ".teller");
config.rolesAuthority.toHexString().write(OUTPUT_JSON_PATH, ".rolesAuthority");
}

function _deployTeller(ConfigReader.Config memory config) public returns (address teller) {
Expand Down
2 changes: 1 addition & 1 deletion test/LiveDeploy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ contract LiveDeploy is ForkTest, DeployAll {

// Run the deployment scripts

run(FILE_NAME);
runLiveTest(FILE_NAME);

// check for if all rate providers are deployed, if not error
for (uint256 i; i < mainConfig.assets.length; ++i) {
Expand Down

0 comments on commit 7b22afa

Please sign in to comment.