Skip to content

Commit

Permalink
Merge pull request #368 from omisego/truffle-migrations-output-to-file
Browse files Browse the repository at this point in the history
truffle-migrations outputs saves to a file
  • Loading branch information
kendricktan committed Oct 18, 2019
2 parents b62863a + f1d56df commit 555a7cd
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions plasma_framework/migrations/6_output_results.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* eslint-disable no-console */

const PlasmaFramework = artifacts.require('PlasmaFramework');

const fs = require('fs');
const path = require('path');
const config = require('./config.js');

const PlasmaFramework = artifacts.require('PlasmaFramework');

module.exports = async (
deployer,
_,
Expand All @@ -15,12 +17,21 @@ module.exports = async (
const erc20Vault = await plasmaFramework.vaults(config.registerKeys.vaultId.erc20);
const paymentExitGame = await plasmaFramework.exitGames(config.registerKeys.txTypes.payment);

console.log(JSON.stringify({
plasma_framework_tx_hash: `${PlasmaFramework.network.transactionHash}`.toLowerCase(),
plasma_framework: `${plasmaFramework.address}`.toLowerCase(),
const data = JSON.stringify({
authority_address: `${authorityAddress}`.toLowerCase(),
eth_vault: `${ethVault}`.toLowerCase(),
erc20_vault: `${erc20Vault}`.toLowerCase(),
payment_exit_game: `${paymentExitGame}`.toLowerCase(),
authority_address: `${authorityAddress}`.toLowerCase(),
}));
plasma_framework_tx_hash: `${PlasmaFramework.network.transactionHash}`.toLowerCase(),
plasma_framework: `${plasmaFramework.address}`.toLowerCase(),
});

console.log(data);

// Save to `output.json`
const buildDir = path.resolve(__dirname, '../build');
if (!fs.existsSync(buildDir)) {
fs.mkdirSync(buildDir);
}
fs.writeFileSync(path.resolve(buildDir, 'outputs.json'), data);
};

0 comments on commit 555a7cd

Please sign in to comment.