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

txscript: group reserved op code tests. #1355

Merged
merged 1 commit into from
Jul 30, 2018
Merged

Conversation

dnldd
Copy link
Member

@dnldd dnldd commented Jul 18, 2018

This is work towards #1331

@davecgh davecgh added this to the 1.3.0 milestone Jul 20, 2018
@dnldd dnldd changed the title [wip] txscript: group reserved op code tests. txscript: group reserved op code tests. Jul 23, 2018
["0", "IF 0xfd ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfd allowed if not executed"],
["0", "IF 0xfe ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfe allowed if not executed"],
["0", "IF 0xff ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xff allowed if not executed"],
["RESERVED opcode tests"],
Copy link
Member

Choose a reason for hiding this comment

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

This seems misplaced.

["NOP", "BLAKE256 1", "NONE", "ERR_INVALID_STACK_OPERATION"],
["NOP", "HASH160 1", "NONE", "ERR_INVALID_STACK_OPERATION"],
["NOP", "HASH256 1", "NONE", "ERR_INVALID_STACK_OPERATION"],
["0x00", "SIZE 0 EQUAL", "NONE", "OK", "Basic OP_0 execution"],
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should be up under the Tests for test harness itself section.

["NOP", "HASH160 1", "NONE", "ERR_INVALID_STACK_OPERATION"],
["NOP", "HASH256 1", "NONE", "ERR_INVALID_STACK_OPERATION"],
["0x00", "SIZE 0 EQUAL", "NONE", "OK", "Basic OP_0 execution"],
["0x00", "'00' EQUAL", "NONE", "ERR_EVAL_FALSE", "Basic OP_0 execution"],
Copy link
Member

Choose a reason for hiding this comment

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

Should be in the EQUAL test coverage section.


["NOP1","NOP10", "NONE", "ERR_EMPTY_STACK"],
["1", "0x02 0x0100 EQUAL NOT", "NONE", "OK", "Not the same byte array..."],
["0", "0x01 0x80 EQUAL NOT", "NONE", "OK"],
Copy link
Member

Choose a reason for hiding this comment

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

Should be in the EQUAL test coverage section.


["NOP1","NOP10", "NONE", "ERR_EMPTY_STACK"],
["1", "0x02 0x0100 EQUAL NOT", "NONE", "OK", "Not the same byte array..."],
Copy link
Member

Choose a reason for hiding this comment

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

Should be in the EQUAL test coverage section.

["NOP", "0 'a'{2048} <'b'{2048}>{6} 'b'{2024}", "NONE", "ERR_SCRIPT_SIZE", "16385-byte scriptPubKey"],
["1 IF 1 ELSE", "0xff ENDIF", "NONE", "ERR_UNBALANCED_CONDITIONAL", "Invalid because scriptSig and scriptPubKey are processed separately"],
Copy link
Member

Choose a reason for hiding this comment

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

Should be in the IF test coverage section

["1 0x01 NOP10", "HASH160 0x14 0xa880c3383e77efb97808a87ca378539e5f8904ef EQUAL", "DISCOURAGE_UPGRADABLE_NOPS", "ERR_DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in redeemScript"],
["1", "NOP", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discourage NOPx flag allows OP_NOP"],
Copy link
Member

Choose a reason for hiding this comment

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

Should be in the NOP test coverage section.

@dnldd dnldd force-pushed the reserved_tests branch 3 times, most recently from 93beed8 to 7545adb Compare July 30, 2018 03:19
this groups reserved op codes and moves some dangling tests to their respective groups.
@davecgh davecgh merged commit 4fcdfab into decred:master Jul 30, 2018
vctt94 pushed a commit to vctt94/dcrd that referenced this pull request Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants