Add SingleGossip commitment level to use for subscriptions (#10147)

automerge
This commit is contained in:
Tyera Eulberg
2020-05-22 13:55:17 -06:00
committed by GitHub
parent 2324eb9ff9
commit 2928c5d103
3 changed files with 316 additions and 52 deletions

View File

@ -37,6 +37,12 @@ impl CommitmentConfig {
}
}
pub fn single_gossip() -> Self {
Self {
commitment: CommitmentLevel::SingleGossip,
}
}
pub fn ok(self) -> Option<Self> {
if self == Self::default() {
None
@ -46,11 +52,12 @@ impl CommitmentConfig {
}
}
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[serde(rename_all = "camelCase")]
pub enum CommitmentLevel {
Max,
Recent,
Root,
Single,
SingleGossip,
}