summaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/mst.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-01 19:44:09 -0700
committerBryan Newbold <bnewbold@robocracy.org>2022-11-01 19:44:09 -0700
commitf3fdc7ba600c65fdb05efc2fd5e9a651b4b9956e (patch)
treecf2522e44a56fb621a5e72364951ab7a1c29ef45 /adenosine-pds/src/mst.rs
parent96c6dbc6c500a7ca3ebefe4ee4fb91fcb8c1713c (diff)
downloadadenosine-f3fdc7ba600c65fdb05efc2fd5e9a651b4b9956e.tar.gz
adenosine-f3fdc7ba600c65fdb05efc2fd5e9a651b4b9956e.zip
pds: refactor repo code
Diffstat (limited to 'adenosine-pds/src/mst.rs')
-rw-r--r--adenosine-pds/src/mst.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/adenosine-pds/src/mst.rs b/adenosine-pds/src/mst.rs
index 429d8c8..3e01a92 100644
--- a/adenosine-pds/src/mst.rs
+++ b/adenosine-pds/src/mst.rs
@@ -12,25 +12,25 @@ use std::collections::BTreeMap;
use std::path::PathBuf;
#[derive(Debug, DagCbor, PartialEq, Eq)]
-struct CommitNode {
- root: Cid,
- sig: Box<[u8]>,
+pub struct CommitNode {
+ pub root: Cid,
+ pub sig: Box<[u8]>,
}
#[derive(Debug, DagCbor, PartialEq, Eq)]
-struct RootNode {
- auth_token: Option<String>,
- prev: Option<Cid>,
+pub struct RootNode {
+ pub auth_token: Option<String>,
+ pub prev: Option<Cid>,
// TODO: not 'metadata'?
- meta: Cid,
- data: Cid,
+ pub meta: Cid,
+ pub data: Cid,
}
#[derive(Debug, DagCbor, PartialEq, Eq)]
-struct MetadataNode {
- datastore: String, // "mst"
- did: String,
- version: u8, // 1
+pub struct MetadataNode {
+ pub datastore: String, // "mst"
+ pub did: String,
+ pub version: u8, // 1
}
#[derive(Debug, DagCbor, PartialEq, Eq)]
@@ -132,7 +132,7 @@ pub fn dump_mst_keys(db_path: &PathBuf) -> Result<()> {
Ok(())
}
-fn collect_mst_keys(
+pub fn collect_mst_keys(
db: &mut BlockStore<libipld::DefaultParams>,
cid: &Cid,
map: &mut BTreeMap<String, Cid>,