fix(@embark/core): expect `afterDeploy` hook on contracts config environment

In d3f6b43986 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 in 66a5bec46d
This commit is contained in:
Pascal Precht 2018-11-22 18:33:46 +01:00 committed by Pascal Precht
parent 191929832c
commit 903e9d44f2
3 changed files with 14 additions and 14 deletions

View File

@ -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)) {

View File

@ -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',

View File

@ -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",