Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix wrong transaction input for contract deployments #4052

Merged
merged 5 commits into from
Jan 6, 2017
Merged

Conversation

ngotchac
Copy link
Contributor

@ngotchac ngotchac commented Jan 5, 2017

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).

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Jan 5, 2017
@@ -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);
Copy link
Contributor

@jacogr jacogr Jan 5, 2017

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 (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@ngotchac
Copy link
Contributor Author

ngotchac commented Jan 5, 2017

Updated tests

{ type: 'constructor' },
{
type: 'constructor',
inputs: [{ name: 'boolin', type: 'bool' }, { name: 'stringin', type: 'string' }]
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 61dc4f2 on ng-fix-deploy into ** on master**.

@jacogr jacogr added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 5, 2017
@gavofyork gavofyork merged commit 9ab9ff2 into master Jan 6, 2017
@gavofyork gavofyork deleted the ng-fix-deploy branch January 6, 2017 09:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants