-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix wrong transaction input for contract deployments #4052
Conversation
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we fixed a bug, would love a testcase that reproduces it and verifies it fixed so it doesn't happen again. (In the case of fixing bugs, should get into that habit overall)
|
||
const hash = hashRegex.exec(bytecode)[1]; | ||
|
||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
Updated tests |
{ type: 'constructor' }, | ||
{ | ||
type: 'constructor', | ||
inputs: [{ name: 'boolin', type: 'bool' }, { name: 'stringin', type: 'string' }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Small grumble...
Would have preferred to keep a non-parameters constructor in addition to the new with-parameters constructor (i.e. separate tests). The no-parameters tests obviously worked (maybe named incorrectly), it was the with-parameters case that was missing.
Basically if things ever go haywire with some extra stuff added to constructors where we expect none, we won't catch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Changes Unknown when pulling 61dc4f2 on ng-fix-deploy into ** on master**. |
The input contained twice the constructor arguments.
Also show the contract metadata and SWARM hash if available (would be great to be able to use it).