Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: always compile in a minimaldata compliant way #638

Merged
merged 1 commit into from
Oct 5, 2016
Merged

Conversation

dcousens
Copy link
Contributor

@dcousens dcousens commented Sep 29, 2016

I can't decide if this is the right thing to do.
On the one hand, I can't imagine another work flow that isn't a pain in the ass, but at the same time it means decompile(compile(x)) !== x in more cases.

Existing exceptions already exist around non-standard data pushes... so I suppose that makes it more acceptable?

fixtures.valid.forEach(function (f) {
if (f.scriptSig) {
it('(' + f.type + ') compiles ' + f.scriptSig, function () {
var scriptSig = bscript.fromASM(f.scriptSig)

assert.strictEqual(bscript.compile(scriptSig).toString('hex'), f.scriptSigHex)
Copy link
Contributor Author

@dcousens dcousens Sep 29, 2016

Choose a reason for hiding this comment

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

the explicit compile here was actually a double up (it is already done in fromASM), I updated the description of the test and removed it


assert.strictEqual(bscript.compile(chunksNS).toString('hex'), f.scriptSigHex)

// toASM converts verbatim, only `compile` transforms the script to a minimalpush compliant script
Copy link
Contributor Author

Choose a reason for hiding this comment

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

and here lies some more confusing aspects of this change

@dcousens
Copy link
Contributor Author

Fixes #631

@dcousens
Copy link
Contributor Author

dcousens commented Sep 29, 2016

ping @fanatid, @jprichardson, @rubensayshi, @Runn1ng, @Sjors for any opinions

@dcousens
Copy link
Contributor Author

We probably need more non-standard script tests anyway...

@dcousens
Copy link
Contributor Author

dcousens commented Oct 4, 2016

any comments?

@dcousens
Copy link
Contributor Author

dcousens commented Oct 5, 2016

This is in line with #640

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants