Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed all the dead code. #153

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cesride"
version = "0.6.2"
version = "0.6.3"
edition = "2021"
description = "Cryptographic primitives for use with Composable Event Streaming Representation (CESR)"
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions src/core/bexter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ mod test {
assert_eq!(bexter.bext().unwrap(), bext);
}

#[rstest]
fn unhappy() {
Copy link
Collaborator

@jasoncolburne jasoncolburne Oct 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, add an #[rstest] or #[test] tag above

assert!(Bexter::new(
None,
Expand Down
20 changes: 0 additions & 20 deletions src/core/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,6 @@ pub mod Ids {
const REVER_STRING: &str = "(?P<ident>[A-Z]{4})(?P<major>[0-9a-f])(?P<minor>[0-9a-f])(?P<kind>[A-Z]{4})(?P<size>[0-9a-f]{6})_";
const IDENTS: &[&str] = &[Identage::ACDC, Identage::KERI];
const SERIALS: &[&str] = &[Serialage::JSON];
const ILKS: &[&str] = &[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I use these externally

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be wrong though, I may just use Ilkage actually

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I wasn't aware that this library was in use yet. Is it consumed in one of the public WebOfTrust tools or in a private project?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's consumed by my company, Qui Identity. I have a KERI/ACDC implementation in Rust in a library we make use of.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked, I do only use Ilkage:

❯ rg ILKS .
❯ rg Ilkage .
./src/keri/verification.rs
4:use cesride::{common::Ilkage, data::Value, Matter, Sadder, Saider, Seqner, Serder};
11:        Ilkage::vcp => serder.pre(),
12:        Ilkage::iss | Ilkage::rev => serder.ked()["ri"].to_string(),

./src/keri/parsing.rs
4:    common::{Identage, Ilkage},
47:                        Ilkage::icp | Ilkage::rot | Ilkage::ixn => {
77:                        Ilkage::vcp | Ilkage::iss | Ilkage::rev => match group {
... and so forth

Ilkage::icp,
Ilkage::rot,
Ilkage::ixn,
Ilkage::dip,
Ilkage::drt,
Ilkage::rct,
Ilkage::ksn,
Ilkage::qry,
Ilkage::rpy,
Ilkage::exn,
Ilkage::pro,
Ilkage::bar,
Ilkage::vcp,
Ilkage::vrt,
Ilkage::iss,
Ilkage::rev,
Ilkage::bis,
Ilkage::brv,
];

pub(crate) const DUMMY: u8 = b'#';

Expand Down
4 changes: 0 additions & 4 deletions src/core/prefixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,6 @@ mod test {
assert!(result);
}

fn build_verfer(code: &str, raw: &[u8]) -> Verfer {
Verfer::new(Some(code), Some(raw), None, None, None).unwrap()
}

#[rstest]
#[case(
None,
Expand Down
14 changes: 0 additions & 14 deletions src/core/salter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ mod test {
}

impl Seal {
pub fn new(i: &str, s: &str, d: &str, last: Option<bool>) -> Self {
let last = last.unwrap_or(false);

Self { i: i.to_string(), s: s.to_string(), d: d.to_string(), last }
}

pub fn i(&self) -> String {
self.i.clone()
}
Expand Down Expand Up @@ -370,14 +364,6 @@ mod test {

Ok(Vault { current, next })
}

pub fn current(&self) -> Vec<Signer> {
self.current.clone()
}

pub fn next(&self) -> Vec<Signer> {
self.next.clone()
}
}

fn messagize(
Expand Down
10 changes: 0 additions & 10 deletions src/core/serder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,6 @@ pub(crate) mod test {
assert!(Serder::new(None, None, None, Some(&ked), None).is_err());
}

pub(crate) mod traiter {
#[allow(non_upper_case_globals)]
#[allow(non_snake_case)]
mod Codex {
const EstOnly: &str = "EO";
const DoNotDelegate: &str = "DND";
const NoBackeds: &str = "NB";
}
}

// what follows is a simple inception function. it is used above to verify serder functionality.

// this function uses convenience methods unlike most test code. it is likely that it will
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// TODO: remove before 1.0.0
#![allow(dead_code)]
#![deny(warnings)]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simply remove this I think

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I see the change. Nice

#[macro_use]
pub mod data;
Expand Down
Loading