From 045a85eb39517464d4a300cc180ac8b834125dec Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sun, 6 Nov 2022 20:55:28 -0800 Subject: pds: switch to adenosine-common for identifiers --- adenosine-pds/Cargo.toml | 4 ++-- adenosine-pds/src/lib.rs | 6 +++--- adenosine-pds/src/repo.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'adenosine-pds') diff --git a/adenosine-pds/Cargo.toml b/adenosine-pds/Cargo.toml index e7f92ea..5bc134e 100644 --- a/adenosine-pds/Cargo.toml +++ b/adenosine-pds/Cargo.toml @@ -27,7 +27,7 @@ jsonschema = "*" schemafy = "*" rouille = "*" iroh-car = { version = "0.1.0-vendored.0", path = "../iroh-car" } -adenosine-cli = { version = "0.1.0-dev.0", path = "../adenosine-cli" } +adenosine-common = { version = "0.1.0-dev.0", path = "../adenosine-common" } tokio = { version = "1", features = ["full"] } futures = "0.3" sha256 = "*" @@ -48,7 +48,7 @@ maintainer = "Bryan Newbold " depends = "$auto" section = "utility" priority = "optional" -extended-description = """"TODO""" +extended-description = """Simple informal personal data server (PDS) for AT protocol and bsky.app""" assets = [ ["target/release/adenosine-pds", "usr/bin/", "755"], #["../extra/adenosine-pds.1", "usr/share/man/man1/", "644"], diff --git a/adenosine-pds/src/lib.rs b/adenosine-pds/src/lib.rs index a4b6114..5803782 100644 --- a/adenosine-pds/src/lib.rs +++ b/adenosine-pds/src/lib.rs @@ -1,4 +1,4 @@ -use adenosine_cli::{AtUri, Did, Nsid, Tid, TidLord}; +use adenosine_common::identifiers::{Did, Nsid, Tid, TidLord}; use anyhow::Context; use anyhow::{anyhow, Result}; use libipld::Cid; @@ -381,7 +381,7 @@ fn xrpc_post_handler( w.rkey .as_ref() .map(|t| Tid::from_str(&t).unwrap()) - .unwrap_or_else(|| srv.tid_gen.next()), + .unwrap_or_else(|| srv.tid_gen.next_tid()), json_value_into_ipld(w.value.clone()), ), "update" => Mutation::Update( @@ -419,7 +419,7 @@ fn xrpc_post_handler( let last_commit = srv.repo.get_commit(&commit_cid)?; let mutations: Vec = vec![Mutation::Create( collection, - srv.tid_gen.next(), + srv.tid_gen.next_tid(), json_value_into_ipld(record), )]; debug!("mutating tree"); diff --git a/adenosine-pds/src/repo.rs b/adenosine-pds/src/repo.rs index d8c4451..442f81b 100644 --- a/adenosine-pds/src/repo.rs +++ b/adenosine-pds/src/repo.rs @@ -1,6 +1,6 @@ use crate::load_car_to_blockstore; use crate::mst::{collect_mst_keys, generate_mst, CommitNode, MetadataNode, RootNode}; -use adenosine_cli::{Did, Nsid, Tid}; +use adenosine_common::identifiers::{Nsid, Tid}; use anyhow::{anyhow, ensure, Context, Result}; use ipfs_sqlite_block_store::BlockStore; use libipld::cbor::DagCborCodec; -- cgit v1.2.3