Add a default commitment-level (#10935)

This commit is contained in:
Greg Fitzgerald 2020-07-06 21:05:55 -06:00 committed by GitHub
parent 960f6f6f07
commit 119949d4d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

@ -1,17 +1,9 @@
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Default, Clone, Copy, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct CommitmentConfig {
pub commitment: CommitmentLevel,
}
impl Default for CommitmentConfig {
fn default() -> Self {
CommitmentConfig {
commitment: CommitmentLevel::Max,
}
}
}
impl CommitmentConfig {
pub fn recent() -> Self {
Self {
@ -61,3 +53,9 @@ pub enum CommitmentLevel {
Single,
SingleGossip,
}
impl Default for CommitmentLevel {
fn default() -> Self {
Self::Max
}
}