-
Notifications
You must be signed in to change notification settings - Fork 14
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
Replace generate_* functions with methods of HpkeKeypair #3287
Conversation
let leader_hpke_keypairs = [HpkeKeypair::test(), HpkeKeypair::test_with_id(1)]; | ||
let helper_hpke_keypairs = [HpkeKeypair::test(), HpkeKeypair::test_with_id(1)]; |
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.
I will fix this flake in another PR. I'm surprised this has never flaked on me before.
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.
just a couple of minor code-golfing comments
pub fn generate_test_hpke_config_and_private_key() -> HpkeKeypair { | ||
generate_hpke_config_and_private_key( | ||
impl HpkeKeypair { | ||
pub fn test() -> Self { |
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.
nit: this could fall through to a call to test_with_id
@@ -341,8 +336,8 @@ pub mod test_util { | |||
.unwrap() | |||
} | |||
|
|||
pub fn generate_test_hpke_config_and_private_key_with_id(id: u8) -> HpkeKeypair { | |||
generate_hpke_config_and_private_key( | |||
pub fn test_with_id(id: u8) -> Self { |
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.
nit: this could fall through to a call to test_with_ciphersuite
Small refactor.
generate_test_hpke_config_and_private_key_with_id_and_ciphersuite()
is a pretty incredible name, so let's shorten that up by making these functions methods onHpkeKeypair
.A lot of ways this could be cleaned up, e.g. builder pattern,
impl Distribution
, but this seemed the most straightforward win to me.