Skip to content

Commit

Permalink
config: serialize field names in kebab-case
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed May 31, 2022
1 parent af867e8 commit 8659966
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/sui-config/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use sui_types::committee::{Committee, EpochId};
use sui_types::crypto::{KeyPair, PublicKeyBytes};

#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub struct NodeConfig {
pub key_pair: KeyPair,
pub db_path: PathBuf,
Expand Down Expand Up @@ -68,6 +69,7 @@ impl NodeConfig {
}

#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub struct ConsensusConfig {
pub consensus_address: Multiaddr,
pub consensus_db_path: PathBuf,
Expand Down Expand Up @@ -100,6 +102,7 @@ impl ConsensusConfig {

//TODO get this information from on-chain + some way to do network discovery
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub struct CommitteeConfig {
pub epoch: EpochId,
pub validator_set: Vec<ValidatorInfo>,
Expand Down Expand Up @@ -127,6 +130,7 @@ impl CommitteeConfig {
/// Publicly known information about a validator
/// TODO read most of this from on-chain
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub struct ValidatorInfo {
pub public_key: PublicKeyBytes,
pub stake: usize,
Expand Down

0 comments on commit 8659966

Please sign in to comment.