Skip to content

Commit

Permalink
feat: implement genesis pk generator
Browse files Browse the repository at this point in the history
  • Loading branch information
DieracDelta committed Dec 2, 2023
1 parent 59ff0de commit 27794d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 5 additions & 1 deletion crates/hotshot-signature-key/src/bn254/bn254_pub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,12 @@ impl SignatureKey for BLSPubKey {
}

fn genesis_proposer_pk() -> Self {
use jf_primitives::signatures::bls_over_bn254::KeyPair;
use rand::rngs::mock::StepRng;
let mut my_rng = StepRng::new(42, 1337);
let kp = KeyPair::generate(&mut my_rng);
BLSPubKey {
pub_key: unimplemented!(),
pub_key: kp.ver_key(),
}
}
}
9 changes: 3 additions & 6 deletions crates/testing/tests/network_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ async fn test_network_task() {
let vid_disperse = vid.disperse(&encoded_transactions).unwrap();
let payload_commitment = vid_disperse.commit;
let signature =
<TestTypes as hotshot_types::traits::node_implementation::NodeType>::SignatureKey::sign(
api.private_key(),
payload_commitment.as_ref(),
)
.expect("Failed to sign block commitment");
let da_proposal = Proposal {
<TestTypes as NodeType>::SignatureKey::sign(api.private_key(), payload_commitment.as_ref())
.expect("Failed to sign block commitment");
let da_proposal = Proposal::<TestTypes, _> {
data: DAProposal {
encoded_transactions: encoded_transactions.clone(),
metadata: (),
Expand Down

0 comments on commit 27794d0

Please sign in to comment.