Skip to content

Commit

Permalink
Create sssc.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 7, 2024
1 parent 471ffe6 commit f85c23e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions consensus/sssc/sssc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use std::collections::HashMap;

struct SSSCA {
shards: HashMap<String, Vec<String>>,
}

impl SSSCA {
fn new() -> Self {
SSSCA {
shards: HashMap::new(),
}
}

fn add_shard(&mut self, shard_id: String, nodes: Vec<String>) {
self.shards.insert(shard_id, nodes);
}

fn get_shard(&self, shard_id: String) -> Option<&Vec<String>> {
self.shards.get(&shard_id)
}
}

0 comments on commit f85c23e

Please sign in to comment.