Skip to content

Commit

Permalink
Add hex encoding Serde attribute to Sr25519 keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Nov 15, 2021
1 parent 259ddd9 commit 1acc5b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions proto/src/prost/tendermint.crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub mod public_key {
#[serde(rename = "tendermint/PubKeySecp256k1", with = "crate::serializers::bytes::base64string")]
Secp256k1(::prost::alloc::vec::Vec<u8>),
#[prost(bytes, tag="3")]
#[serde(rename = "tendermint/PubKeySr25519", with = "crate::serializers::bytes::base64string")]
Sr25519(::prost::alloc::vec::Vec<u8>),
}
}
2 changes: 2 additions & 0 deletions tools/proto-compiler/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const PART_SET_HEADER_TOTAL: &str =
r#"#[serde(with = "crate::serializers::part_set_header_total")]"#;
const RENAME_EDPUBKEY: &str = r#"#[serde(rename = "tendermint/PubKeyEd25519", with = "crate::serializers::bytes::base64string")]"#;
const RENAME_SECPPUBKEY: &str = r#"#[serde(rename = "tendermint/PubKeySecp256k1", with = "crate::serializers::bytes::base64string")]"#;
const RENAME_SRPUBKEY: &str = r#"#[serde(rename = "tendermint/PubKeySr25519", with = "crate::serializers::bytes::base64string")]"#;
const RENAME_DUPLICATEVOTE: &str = r#"#[serde(rename = "tendermint/DuplicateVoteEvidence")]"#;
const RENAME_LIGHTCLIENTATTACK: &str =
r#"#[serde(rename = "tendermint/LightClientAttackEvidence")]"#;
Expand Down Expand Up @@ -143,6 +144,7 @@ pub static CUSTOM_FIELD_ATTRIBUTES: &[(&str, &str)] = &[
".tendermint.crypto.PublicKey.sum.secp256k1",
RENAME_SECPPUBKEY,
),
(".tendermint.crypto.PublicKey.sum.sr25519", RENAME_SRPUBKEY),
(
".tendermint.types.Evidence.sum.duplicate_vote_evidence",
RENAME_DUPLICATEVOTE,
Expand Down

0 comments on commit 1acc5b3

Please sign in to comment.