Skip to content

Commit

Permalink
Removed all the dead code. (#153)
Browse files Browse the repository at this point in the history
* Removed all the dead code.

* Added back unhappy test and notated it as a test per PR change request
  • Loading branch information
daidoji committed Nov 30, 2023
1 parent 43a011b commit 7cd5453
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 51 deletions.
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() {
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] = &[
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)]

#[macro_use]
pub mod data;
Expand Down

0 comments on commit 7cd5453

Please sign in to comment.