-
Notifications
You must be signed in to change notification settings - Fork 56
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
Implemented tests and validation for P2MS #257
base: main
Are you sure you want to change the base?
Conversation
@supreme2580 is attempting to deploy a commit to the keep-starknet-strange Team on Vercel. A member of the Team first needs to authorize it. |
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.
Nice work so far!
} | ||
} | ||
|
||
// #[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.
This test is currently not running, I think
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.
Will confirm this and get back to you
} | ||
|
||
#[test] | ||
fn test_p2ms_edge_cases() { |
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.
Which transaction is this testing?
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.
@b-j-roberts This is to test cases of 1 of 1 multisig, 1 of 2 multisig with one of the keys being invalid and 2-of-3 multisig with maximum allowed public keys (20)
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 add the txids to the script? If they are 3 separate transactions, they should all be different tests too and run validate 3 times ( one for each ).
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.
Will split asap
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.
@b-j-roberts I have split the edge cases into individual tests
|
||
#[test] | ||
fn test_p2ms_1of1() { | ||
// Test case for 1-of-1 multisig |
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 add the txid to this like the other tests above? Trying to verify this test
|
||
#[test] | ||
fn test_p2ms_1of2_invalid_pubkey() { | ||
// Test case for 1-of-2 multisig with an invalid public key |
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 add the txid to this as well?
|
||
let res = validate::validate_p2ms(@transaction, 0, utxo_hints); | ||
assert!(res.is_err(), "P2MS 1-of-2 with invalid public key should fail validation"); | ||
} |
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.
There is also a 2-of-3 ms example and a 20-of-20 example that would be good to have tests for if you can.
Closes: #248