-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feature: Added typed opcode definitions #2099
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ test/*.js | |
test/integration/*.js | ||
!test/ts-node-register.js | ||
docs | ||
plugin | ||
plugin | ||
.idea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,127 @@ | ||
declare const OPS: { | ||
[key: string]: number; | ||
}; | ||
declare const REVERSE_OPS: { | ||
[key: number]: string; | ||
export interface Opcodes { | ||
readonly OP_FALSE: number; | ||
readonly OP_0: number; | ||
readonly OP_PUSHDATA1: number; | ||
readonly OP_PUSHDATA2: number; | ||
readonly OP_PUSHDATA4: number; | ||
readonly OP_1NEGATE: number; | ||
readonly OP_RESERVED: number; | ||
readonly OP_TRUE: number; | ||
readonly OP_1: number; | ||
readonly OP_2: number; | ||
readonly OP_3: number; | ||
readonly OP_4: number; | ||
readonly OP_5: number; | ||
readonly OP_6: number; | ||
readonly OP_7: number; | ||
readonly OP_8: number; | ||
readonly OP_9: number; | ||
readonly OP_10: number; | ||
readonly OP_11: number; | ||
readonly OP_12: number; | ||
readonly OP_13: number; | ||
readonly OP_14: number; | ||
readonly OP_15: number; | ||
readonly OP_16: number; | ||
readonly OP_NOP: number; | ||
readonly OP_VER: number; | ||
readonly OP_IF: number; | ||
readonly OP_NOTIF: number; | ||
readonly OP_VERIF: number; | ||
readonly OP_VERNOTIF: number; | ||
readonly OP_ELSE: number; | ||
readonly OP_ENDIF: number; | ||
readonly OP_VERIFY: number; | ||
readonly OP_RETURN: number; | ||
readonly OP_TOALTSTACK: number; | ||
readonly OP_FROMALTSTACK: number; | ||
readonly OP_2DROP: number; | ||
readonly OP_2DUP: number; | ||
readonly OP_3DUP: number; | ||
readonly OP_2OVER: number; | ||
readonly OP_2ROT: number; | ||
readonly OP_2SWAP: number; | ||
readonly OP_IFDUP: number; | ||
readonly OP_DEPTH: number; | ||
readonly OP_DROP: number; | ||
readonly OP_DUP: number; | ||
readonly OP_NIP: number; | ||
readonly OP_OVER: number; | ||
readonly OP_PICK: number; | ||
readonly OP_ROLL: number; | ||
readonly OP_ROT: number; | ||
readonly OP_SWAP: number; | ||
readonly OP_TUCK: number; | ||
readonly OP_CAT: number; | ||
readonly OP_SUBSTR: number; | ||
readonly OP_LEFT: number; | ||
readonly OP_RIGHT: number; | ||
readonly OP_SIZE: number; | ||
readonly OP_INVERT: number; | ||
readonly OP_AND: number; | ||
readonly OP_OR: number; | ||
readonly OP_XOR: number; | ||
readonly OP_EQUAL: number; | ||
readonly OP_EQUALVERIFY: number; | ||
readonly OP_RESERVED1: number; | ||
readonly OP_RESERVED2: number; | ||
readonly OP_1ADD: number; | ||
readonly OP_1SUB: number; | ||
readonly OP_2MUL: number; | ||
readonly OP_2DIV: number; | ||
readonly OP_NEGATE: number; | ||
readonly OP_ABS: number; | ||
readonly OP_NOT: number; | ||
readonly OP_0NOTEQUAL: number; | ||
readonly OP_ADD: number; | ||
readonly OP_SUB: number; | ||
readonly OP_MUL: number; | ||
readonly OP_DIV: number; | ||
readonly OP_MOD: number; | ||
readonly OP_LSHIFT: number; | ||
readonly OP_RSHIFT: number; | ||
readonly OP_BOOLAND: number; | ||
readonly OP_BOOLOR: number; | ||
readonly OP_NUMEQUAL: number; | ||
readonly OP_NUMEQUALVERIFY: number; | ||
readonly OP_NUMNOTEQUAL: number; | ||
readonly OP_LESSTHAN: number; | ||
readonly OP_GREATERTHAN: number; | ||
readonly OP_LESSTHANOREQUAL: number; | ||
readonly OP_GREATERTHANOREQUAL: number; | ||
readonly OP_MIN: number; | ||
readonly OP_MAX: number; | ||
readonly OP_WITHIN: number; | ||
readonly OP_RIPEMD160: number; | ||
readonly OP_SHA1: number; | ||
readonly OP_SHA256: number; | ||
readonly OP_HASH160: number; | ||
readonly OP_HASH256: number; | ||
readonly OP_CODESEPARATOR: number; | ||
readonly OP_CHECKSIG: number; | ||
readonly OP_CHECKSIGVERIFY: number; | ||
readonly OP_CHECKMULTISIG: number; | ||
readonly OP_CHECKMULTISIGVERIFY: number; | ||
readonly OP_CHECKLOCKTIMEVERIFY: number; | ||
readonly OP_CHECKSEQUENCEVERIFY: number; | ||
readonly OP_CHECKSIGADD: number; | ||
readonly OP_NOP1: number; | ||
readonly OP_NOP2: number; | ||
readonly OP_NOP3: number; | ||
readonly OP_NOP4: number; | ||
readonly OP_NOP5: number; | ||
readonly OP_NOP6: number; | ||
readonly OP_NOP7: number; | ||
readonly OP_NOP8: number; | ||
readonly OP_NOP9: number; | ||
readonly OP_NOP10: number; | ||
readonly OP_PUBKEYHASH: number; | ||
readonly OP_PUBKEY: number; | ||
readonly OP_INVALIDOPCODE: number; | ||
} | ||
declare const OPS: Opcodes; | ||
type ReverseOpcodes = { | ||
[K in keyof Opcodes as Opcodes[K]]: K; | ||
}; | ||
declare const REVERSE_OPS: ReverseOpcodes; | ||
export { OPS, REVERSE_OPS }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
345264