Skip to content

Commit

Permalink
update keys HRP
Browse files Browse the repository at this point in the history
  • Loading branch information
zeegomo committed Sep 24, 2021
1 parent 8a967bd commit 128f6da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions jcli/src/jcli_lib/vote/bech32_constants.rs
@@ -1,7 +1,7 @@
pub const COMMUNICATION_SK_HRP: &str = "p256k1_vcommsk";
pub const COMMUNICATION_PK_HRP: &str = "p256k1_vcommpk";
pub const COMMUNICATION_SK_HRP: &str = "vcommsk";
pub const COMMUNICATION_PK_HRP: &str = "vcommpk";

pub const MEMBER_PK_HRP: &str = jormungandr_lib::interfaces::MEMBER_PUBLIC_KEY_BECH32_HRP;
pub const MEMBER_SK_HRP: &str = "p256k1_membersk";
pub const MEMBER_SK_HRP: &str = "membersk";

pub const ENCRYPTING_VOTE_PK_HRP: &str = "p256k1_votepk";
pub const ENCRYPTING_VOTE_PK_HRP: &str = "votepk";
4 changes: 2 additions & 2 deletions jormungandr-lib/src/interfaces/vote.rs
Expand Up @@ -70,7 +70,7 @@ impl From<VotePrivacy> for vote::PayloadType {

struct SerdeMemberPublicKey(chain_vote::MemberPublicKey);

pub const MEMBER_PUBLIC_KEY_BECH32_HRP: &str = "p256k1_memberpk";
pub const MEMBER_PUBLIC_KEY_BECH32_HRP: &str = "memberpk";

impl<'de> Deserialize<'de> for SerdeMemberPublicKey {
fn deserialize<D>(deserializer: D) -> Result<Self, <D as Deserializer<'de>>::Error>
Expand Down Expand Up @@ -784,7 +784,7 @@ mod test {
let member_key =
chain_vote::MemberState::new(&mut rng, 1, &crs, &[comm_key.to_public()], 0);
let pk = member_key.public_key();
let pks = vec![bech32::encode("p256k1_memberpk", pk.to_bytes().to_base32()).unwrap()];
let pks = vec![bech32::encode("memberpk", pk.to_bytes().to_base32()).unwrap()];
let json = serde_json::to_string(&pks).unwrap();

let result: Vec<SerdeMemberPublicKey> = serde_json::from_str(&json).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions testing/jormungandr-testing-utils/src/wallet/committee.rs
Expand Up @@ -21,9 +21,9 @@ use std::fmt;
use std::fs::File;
use std::io::Write;

pub const COMMUNICATION_SK_HRP: &str = "p256k1_vcommsk";
pub const MEMBER_SK_HRP: &str = "p256k1_membersk";
pub const ENCRYPTING_VOTE_PK_HRP: &str = "p256k1_votepk";
pub const COMMUNICATION_SK_HRP: &str = "vcommsk";
pub const MEMBER_SK_HRP: &str = "membersk";
pub const ENCRYPTING_VOTE_PK_HRP: &str = "votepk";

#[derive(Clone)]
pub struct PrivateVoteCommitteeData {
Expand Down

0 comments on commit 128f6da

Please sign in to comment.