-
Notifications
You must be signed in to change notification settings - Fork 157
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
completed txscript tests and fixed some opcodes #242
Conversation
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.
Can you also run the tests on https://github.com/kaspanet/kaspad/blob/master/domain/consensus/utils/txscript/data/script_tests.json ? Can be done on another PR
044f445
to
73a8727
Compare
I wrote a test that run What about the rest of the tests in |
|
||
#[cfg(test)] | ||
#[allow(unused_comparisons)] | ||
pub(crate) fn parse_short_form(test: String) -> ScriptBuilderResult<Vec<u8>> |
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.
Why call it test
?
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.
Why have you dropped the version
arg? When we'll have multiple version the result of this function can be affected by the script pub key version
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.
Wouldn't changing the version require change in the JSON file as well, and therefore some cascading changes anyway (parsing, functions calls etc)? I don't think leaving the version (that is just hard coded in calls) saves work in the long term
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.
Why call it
test
?
This function uses only to parse test scripts. I can change it to test_script
} | ||
|
||
fn always_illegal(&self) -> bool { | ||
matches!(CODE, codes::OpVerIf | codes::OpVerNotIf) |
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.
What about OpReserved
,OpReserved1
and OpReserved2
?
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 only ones checked pre-execution in go-kaspad
are OpVerIf
and OpVerNotIf
.
It follows from here:
https://github.com/kaspanet/kaspad/blob/92574e623f0741d57d6a097498866dd21c5ce6da/domain/consensus/utils/txscript/opcode.go#L656
ec97d68
to
be7011c
Compare
* completed txscript tests and fixed some opcodes * implemented bitcoind tests and fixed errors discovered in testing process * changed to go-kaspad * fixed clippy issue * fixed from PR
No description provided.