mirror of https://github.com/embarklabs/embark.git
feat(@embark/pipeline): add minimalContractSize to remove bytecode
This commit is contained in:
parent
9e74d32f5f
commit
b0cccaea05
|
@ -51,6 +51,9 @@ module.exports = {
|
||||||
// contracts section.
|
// contracts section.
|
||||||
//strategy: 'implicit',
|
//strategy: 'implicit',
|
||||||
|
|
||||||
|
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||||
|
// minimalContractSize: false,
|
||||||
|
|
||||||
contracts: {
|
contracts: {
|
||||||
// example:
|
// example:
|
||||||
//SimpleStorage: {
|
//SimpleStorage: {
|
||||||
|
|
|
@ -51,6 +51,9 @@ module.exports = {
|
||||||
// contracts section.
|
// contracts section.
|
||||||
//strategy: 'implicit',
|
//strategy: 'implicit',
|
||||||
|
|
||||||
|
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||||
|
// minimalContractSize: false,
|
||||||
|
|
||||||
contracts: {
|
contracts: {
|
||||||
SimpleStorage: {
|
SimpleStorage: {
|
||||||
fromIndex: 0,
|
fromIndex: 0,
|
||||||
|
|
|
@ -51,6 +51,9 @@ module.exports = {
|
||||||
// contracts section.
|
// contracts section.
|
||||||
//strategy: 'implicit',
|
//strategy: 'implicit',
|
||||||
|
|
||||||
|
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||||
|
// minimalContractSize: false,
|
||||||
|
|
||||||
contracts: {
|
contracts: {
|
||||||
// example:
|
// example:
|
||||||
//SimpleStorage: {
|
//SimpleStorage: {
|
||||||
|
|
|
@ -341,6 +341,14 @@ class Pipeline {
|
||||||
},
|
},
|
||||||
function writeContractsJSON(contracts, next) {
|
function writeContractsJSON(contracts, next) {
|
||||||
async.each(contracts, (contract, eachCb) => {
|
async.each(contracts, (contract, eachCb) => {
|
||||||
|
if (self.embark.config.contractsConfig.minimalContractSize) {
|
||||||
|
contract = Object.assign({}, contract);
|
||||||
|
delete contract.code;
|
||||||
|
delete contract.runtimeBytecode;
|
||||||
|
delete contract.realRuntimeBytecode;
|
||||||
|
delete contract.gasEstimates;
|
||||||
|
delete contract.swarmHash;
|
||||||
|
}
|
||||||
self.fs.writeJson(dappPath(
|
self.fs.writeJson(dappPath(
|
||||||
self.buildDir,
|
self.buildDir,
|
||||||
'contracts', contract.className + '.json'
|
'contracts', contract.className + '.json'
|
||||||
|
|
Loading…
Reference in New Issue