mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-20 11:08:08 +00:00
[a] Added applyArgumentPlugins before _determineArguments in ContractDeployer for plugins that calculate arguments dynamically.
[m] Made possible for deploy:contract:beforeDeploy plugin to modify arguments list.
This commit is contained in:
parent
10bf3e4412
commit
e13c0b3724
@ -116,6 +116,11 @@ class ContractDeployer {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
function applyArgumentPlugins(next) {
|
||||||
|
self.plugins.emitAndRunActionsForEvent('deploy:contract:arguments', {contract: contract}, (_params) => {
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
},
|
||||||
function _determineArguments(next) {
|
function _determineArguments(next) {
|
||||||
self.determineArguments(params || contract.args, contract, accounts, (err, realArgs) => {
|
self.determineArguments(params || contract.args, contract, accounts, (err, realArgs) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -189,7 +194,6 @@ class ContractDeployer {
|
|||||||
|
|
||||||
deployContract(contract, callback) {
|
deployContract(contract, callback) {
|
||||||
let self = this;
|
let self = this;
|
||||||
let contractParams = (contract.realArgs || contract.args).slice();
|
|
||||||
let deployObject;
|
let deployObject;
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
@ -239,6 +243,7 @@ class ContractDeployer {
|
|||||||
function createDeployObject(next) {
|
function createDeployObject(next) {
|
||||||
let contractCode = contract.code;
|
let contractCode = contract.code;
|
||||||
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
||||||
|
let contractParams = (contract.realArgs || contract.args).slice();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const dataCode = contractCode.startsWith('0x') ? contractCode : "0x" + contractCode;
|
const dataCode = contractCode.startsWith('0x') ? contractCode : "0x" + contractCode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user