Fix wrong transaction input for contract deployments (#4052)

* Fix mutable options in Contract API

* Add Swarm hash and meta data from Solidity

* Updates tests for contract deployment

* Add test for deploy without constructor Params
This commit is contained in:
Nicolas Gotchac
2017-01-06 10:39:18 +01:00
committed by Gav Wood
parent 1b93d79a90
commit 9ab9ff2381
3 changed files with 119 additions and 14 deletions

View File

@@ -218,14 +218,19 @@ export default class Contract {
}
_encodeOptions (func, options, values) {
options.data = this.getCallData(func, options, values);
return options;
const data = this.getCallData(func, options, values);
return {
...options,
data
};
}
_addOptionsTo (options = {}) {
return Object.assign({
to: this._address
}, options);
return {
to: this._address,
...options
};
}
_bindFunction = (func) => {