-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
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) |
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.
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 |
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.
and here lies some more confusing aspects of this change
Fixes #631 |
ping @fanatid, @jprichardson, @rubensayshi, @Runn1ng, @Sjors for any opinions |
We probably need more non-standard script tests anyway... |
any comments? |
This is in line with #640 |
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?