mirror of https://github.com/embarklabs/embark.git
fix(@embark/core): expect `afterDeploy` hook on contracts config environment
Ind3f6b43986
we ensured that Embark automatically expands `0x0` address to full zero addresses in order to stay backward compatible with existing projects that made use of `0x0`, even after we've upgraded web3, which doesn't allow that syntax anymore. Turns out however, that the address expansion for `afterDeploy` hook was done in the wrong place. This was due to a bug in our documentation that has been fixed in66a5bec46d
This commit is contained in:
parent
191929832c
commit
903e9d44f2
|
@ -341,10 +341,10 @@ Config.prototype.loadContractsConfigFile = function() {
|
|||
}
|
||||
});
|
||||
|
||||
const afterDeploy = newContractsConfig.contracts.afterDeploy;
|
||||
const afterDeploy = newContractsConfig.afterDeploy;
|
||||
|
||||
if (Array.isArray(afterDeploy)) {
|
||||
newContractsConfig.contracts.afterDeploy = afterDeploy.map(replaceZeroAddressShorthand);
|
||||
newContractsConfig.afterDeploy = afterDeploy.map(replaceZeroAddressShorthand);
|
||||
}
|
||||
|
||||
if (!deepEqual(newContractsConfig, this.contractsConfig)) {
|
||||
|
|
|
@ -145,12 +145,12 @@ describe('embark.Config', function () {
|
|||
"onDeploy": [
|
||||
"SimpleStorage.methods.changeAddress('0x0000000000000000000000000000000000000000')"
|
||||
]
|
||||
},
|
||||
"afterDeploy": [
|
||||
"SimpleStorage.methods.changeAddress('0x0000000000000000000000000000000000000000')",
|
||||
"SimpleStorage.methods.changeAddress('$SomeToken')"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"afterDeploy": [
|
||||
"SimpleStorage.methods.changeAddress('0x0000000000000000000000000000000000000000')",
|
||||
"SimpleStorage.methods.changeAddress('$SomeToken')"
|
||||
]
|
||||
};
|
||||
let zeroAddressconfig = new Config({
|
||||
env: 'zeroaddress',
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
"onDeploy": [
|
||||
"SimpleStorage.methods.changeAddress('0x0')"
|
||||
]
|
||||
},
|
||||
"afterDeploy": [
|
||||
"SimpleStorage.methods.changeAddress('0x0')",
|
||||
"SimpleStorage.methods.changeAddress('$SomeToken')"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"afterDeploy": [
|
||||
"SimpleStorage.methods.changeAddress('0x0')",
|
||||
"SimpleStorage.methods.changeAddress('$SomeToken')"
|
||||
]
|
||||
},
|
||||
"myenv": {
|
||||
"gas": "400 Kwei",
|
||||
|
|
Loading…
Reference in New Issue