Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Update snapshot build process
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-es committed Oct 4, 2020
1 parent 6fd3426 commit a94768a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Binary file modified packages/ap-contracts/ap-chain-snapshot.tar.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports.dependencies = [
"_package",
"_deployment",
"_init",
"_export"
];

// run on the ap-chain only
Expand Down
14 changes: 11 additions & 3 deletions packages/ap-contracts/deploy/5-update-deployments-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ async function updateDeploymentsJson(buidlerRuntime) {
throw new Error("unexpected Buidler Runtime Environment");
}

const deploymentsFile = path.resolve(__dirname, '../', 'deployments.json');
// store addresses for ap-chain in ap-chain-snapshot
const deploymentsFile = (chainId !== '1994')
? path.resolve(__dirname, '../', 'deployments.json')
: path.resolve(__dirname, '../ap-chain-snapshot', 'deployments.json');

if (!fs.existsSync(deploymentsFile)) {
fs.writeFileSync(deploymentsFile, JSON.stringify({}, null, 2), { encoding: 'utf-8', flag: 'w'});
}

const deployments = JSON.parse(fs.readFileSync(deploymentsFile, 'utf8'));

/** @type {import('./3-deploy-contracts').ContractsListDeployedItem[]} deployed */
Expand All @@ -34,8 +42,8 @@ async function updateDeploymentsJson(buidlerRuntime) {
(res, rej) => fs.writeFile(
deploymentsFile,
JSON.stringify(deployments, null, 2),
'utf8',
err => {
{ encoding: 'utf8', flag: 'w' },
(err) => {
if (err) return rej(err);
log(`deployments.json saved`);
res();
Expand Down
1 change: 0 additions & 1 deletion packages/ap-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"generate-ts-bindings": "rm -rf ./ts-bindings && typechain --target web3-v1 --outDir ./ts-bindings './build/contracts/*.json'",
"lint": "solhint contracts/**/*.sol",
"lint:fix": "solhint contracts/**/*.sol --fix",
"migrate:ap-chain": "scripts/deploy-contracts.sh ap-chain",
"migrate:goerli": "scripts/deploy-contracts.sh goerli",
"migrate:kovan": "scripts/deploy-contracts.sh kovan",
"migrate:rinkeby": "scripts/deploy-contracts.sh rinkeby",
Expand Down

0 comments on commit a94768a

Please sign in to comment.