Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Nov 17, 2024
1 parent c488db2 commit 9cc646f
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 82 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions crates/cdk-cln/src/bolt12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ use lightning::offers::invoice::Bolt12Invoice;
use lightning::offers::offer::Offer;
use uuid::Uuid;

use super::Cln;
use super::Error;
use super::{Cln, Error};

#[async_trait]
impl MintBolt12Lightning for Cln {
Expand Down
3 changes: 1 addition & 2 deletions crates/cdk/src/amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ use std::cmp::Ordering;
use std::fmt;
use std::str::FromStr;

use serde::{Deserialize, Deserializer, Serialize, Serializer};

use lightning::offers::offer::Offer;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use thiserror::Error;

use crate::nuts::CurrencyUnit;
Expand Down
35 changes: 13 additions & 22 deletions crates/cdk/src/mint/melt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,21 @@ use anyhow::bail;
use lightning::offers::offer::Offer;
use tracing::instrument;

use crate::amount::amount_for_offer;
use crate::cdk_lightning;
use crate::cdk_lightning::MintLightning;
use crate::cdk_lightning::PayInvoiceResponse;
use crate::nuts::nut00::ProofsMethods;
use crate::nuts::nut11::enforce_sig_flag;
use crate::nuts::nut11::EnforceSigFlag;
use crate::{
amount::to_unit, mint::SigFlag, nuts::Id, nuts::MeltQuoteState, types::LnKey, util::unix_time,
Amount, Error,
};

use super::nut05::MeltRequestTrait;
use super::types::PaymentRequest;
use super::BlindSignature;
use super::CurrencyUnit;
use super::MeltQuote;
use super::MeltQuoteBolt11Request;
use super::MeltQuoteBolt11Response;
use super::MeltQuoteBolt12Request;
use super::Mint;
use super::PaymentMethod;
use super::State;
use crate::nuts::PublicKey;
use super::{
BlindSignature, CurrencyUnit, MeltQuote, MeltQuoteBolt11Request, MeltQuoteBolt11Response,
MeltQuoteBolt12Request, Mint, PaymentMethod, State,
};
use crate::amount::{amount_for_offer, to_unit};
use crate::cdk_lightning::{MintLightning, PayInvoiceResponse};
use crate::mint::SigFlag;
use crate::nuts::nut00::ProofsMethods;
use crate::nuts::nut11::{enforce_sig_flag, EnforceSigFlag};
use crate::nuts::{Id, MeltQuoteState, PublicKey};
use crate::types::LnKey;
use crate::util::unix_time;
use crate::{cdk_lightning, Amount, Error};

impl Mint {
fn check_melt_request_acceptable(
Expand Down
11 changes: 5 additions & 6 deletions crates/cdk/src/mint/mint_18.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use tracing::instrument;

use crate::{types::LnKey, util::unix_time, Amount, Error};

use super::{
nut19::{MintQuoteBolt12Request, MintQuoteBolt12Response},
Mint, MintQuote, PaymentMethod,
};
use super::nut19::{MintQuoteBolt12Request, MintQuoteBolt12Response};
use super::{Mint, MintQuote, PaymentMethod};
use crate::types::LnKey;
use crate::util::unix_time;
use crate::{Amount, Error};

impl Mint {
/// Create new mint bolt11 quote
Expand Down
6 changes: 4 additions & 2 deletions crates/cdk/src/mint/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ pub enum PaymentRequest {
}

mod offer_serde {
use super::Offer;
use serde::{self, Deserialize, Deserializer, Serializer};
use std::str::FromStr;

use serde::{self, Deserialize, Deserializer, Serializer};

use super::Offer;

pub fn serialize<S>(offer: &Offer, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
4 changes: 2 additions & 2 deletions crates/cdk/src/nuts/nut20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
use serde::{Deserialize, Serialize};
use thiserror::Error;

use super::nut05::MeltRequestTrait;
use super::{BlindedMessage, CurrencyUnit, PaymentMethod, Proofs};
use crate::Amount;

use super::{nut05::MeltRequestTrait, BlindedMessage, CurrencyUnit, PaymentMethod, Proofs};

/// NUT18 Error
#[derive(Debug, Error)]
pub enum Error {
Expand Down
15 changes: 7 additions & 8 deletions crates/cdk/src/wallet/mint_bolt12.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
use tracing::instrument;

use super::MintQuote;
use crate::amount::SplitTarget;
use crate::dhke::construct_proofs;
use crate::nuts::nut00::ProofsMethods;
use crate::nuts::nut19::{MintQuoteBolt12Request, MintQuoteBolt12Response};
use crate::nuts::{MintBolt11Request, PaymentMethod};
use crate::{
amount::SplitTarget,
dhke::construct_proofs,
nuts::{nut12, PreMintSecrets, SpendingConditions, State},
types::ProofInfo,
util::unix_time,
Amount, Error, Wallet,
use crate::nuts::{
nut12, MintBolt11Request, PaymentMethod, PreMintSecrets, SpendingConditions, State,
};
use crate::types::ProofInfo;
use crate::util::unix_time;
use crate::{Amount, Error, Wallet};

impl Wallet {
/// Mint Bolt12
Expand Down
46 changes: 9 additions & 37 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9cc646f

Please sign in to comment.