Skip to content

Commit

Permalink
chore: use pretty asserts in core
Browse files Browse the repository at this point in the history
  • Loading branch information
ngutech21 committed Jan 9, 2024
1 parent 028ae00 commit cbde0f1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions moksha-core/src/amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub fn generate_random_string() -> String {
#[cfg(test)]
mod tests {
use crate::amount::SplitAmount;
use pretty_assertions::assert_eq;

#[test]
fn test_split_amount() -> anyhow::Result<()> {
Expand Down
1 change: 1 addition & 0 deletions moksha-core/src/dhke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ pub fn public_key_from_hex(hex: &str) -> secp256k1::PublicKey {
mod tests {
use crate::dhke::{public_key_from_hex, Dhke};
use anyhow::Ok;
use pretty_assertions::assert_eq;

fn hex_to_string(hex: &str) -> String {
use hex::FromHex;
Expand Down
7 changes: 3 additions & 4 deletions moksha-core/src/keyset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,10 @@ pub fn derive_pubkey(seed: &str) -> Result<PublicKey, MokshaCoreError> {

#[cfg(test)]
mod tests {
use std::collections::HashMap;

use secp256k1::PublicKey;

use crate::keyset::{derive_pubkey, generate_hash};
use pretty_assertions::assert_eq;
use secp256k1::PublicKey;
use std::collections::HashMap;

fn public_key_from_hex(hex: &str) -> secp256k1::PublicKey {
use hex::FromHex;
Expand Down
1 change: 1 addition & 0 deletions moksha-core/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ pub struct Nut12 {

#[cfg(test)]
mod tests {
use pretty_assertions::assert_eq;

use crate::{
dhke::public_key_from_hex,
Expand Down
1 change: 1 addition & 0 deletions moksha-core/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ mod tests {
proof::{Proof, Proofs},
token::TokenV3,
};
use pretty_assertions::assert_eq;

#[test]
fn test_proofs_for_amount_empty() -> anyhow::Result<()> {
Expand Down

0 comments on commit cbde0f1

Please sign in to comment.