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.
|
||||
//strategy: 'implicit',
|
||||
|
||||
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||
// minimalContractSize: false,
|
||||
|
||||
contracts: {
|
||||
// example:
|
||||
//SimpleStorage: {
|
||||
|
|
|
@ -51,6 +51,9 @@ module.exports = {
|
|||
// contracts section.
|
||||
//strategy: 'implicit',
|
||||
|
||||
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||
// minimalContractSize: false,
|
||||
|
||||
contracts: {
|
||||
SimpleStorage: {
|
||||
fromIndex: 0,
|
||||
|
|
|
@ -51,6 +51,9 @@ module.exports = {
|
|||
// contracts section.
|
||||
//strategy: 'implicit',
|
||||
|
||||
// minimalContractSize, when set to true, tells Embark to generate contract files without the heavy bytecodes
|
||||
// minimalContractSize: false,
|
||||
|
||||
contracts: {
|
||||
// example:
|
||||
//SimpleStorage: {
|
||||
|
|
|
@ -341,6 +341,14 @@ class Pipeline {
|
|||
},
|
||||
function writeContractsJSON(contracts, next) {
|
||||
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.buildDir,
|
||||
'contracts', contract.className + '.json'
|
||||
|
|
Loading…
Reference in New Issue