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

Improve test CLI following removing permissioned mode #770

Merged
merged 6 commits into from
Apr 22, 2024

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Apr 19, 2024

As discussed in #666 there was some small fixes needed to the test CLI. I got stuck on this today because i was trying to use the test CLI, and it was only showing the first 32 bytes of verifying keys (they are 33 bytes).

I have changed the test client to take verifying keys as [u8; 33] rather than Vec<u8> to ensure they are the right size. Ideally we should have a type for a serialized verifying key, but thats a bigger PR.

@@ -190,7 +190,7 @@ async fn test_sign_tx_no_chain() {
update_programs(
&entropy_api,
&rpc,
DAVE_VERIFYING_KEY.to_vec(),
DAVE_VERIFYING_KEY.to_vec().try_into().unwrap(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would not be needed if we made these constants be a [u8; 33]

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be an easy change, no? Or does that introduce too much noise into the PR?

@ameba23 ameba23 requested review from JesseAbram and HCastano April 19, 2024 21:08
Copy link
Collaborator

@HCastano HCastano left a comment

Choose a reason for hiding this comment

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

Thank for catching this!

crates/test-cli/src/main.rs Outdated Show resolved Hide resolved
@@ -23,6 +23,8 @@ pub use synedrion::KeyShare;

use std::time::SystemTime;

pub const VERIFYING_KEY_LENGTH: usize = entropy_shared::VERIFICATION_KEY_LENGTH as usize;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why re-export this instead of using the one from entropy_shared?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because i need a usize and in entropy_shared its a u32 or something. I am unsure about about making it a usize there because of potential issues with usize being different on wasm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually maybe it will be fine, lets try....

@@ -190,7 +190,7 @@ async fn test_sign_tx_no_chain() {
update_programs(
&entropy_api,
&rpc,
DAVE_VERIFYING_KEY.to_vec(),
DAVE_VERIFYING_KEY.to_vec().try_into().unwrap(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be an easy change, no? Or does that introduce too much noise into the PR?

@ameba23 ameba23 merged commit 20ffb61 into master Apr 22, 2024
11 checks passed
@ameba23 ameba23 deleted the peg/improve-test-cli-following-rm-permissioned branch April 22, 2024 16:41
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