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

Add check outgoing payment #357

Merged
merged 1 commit into from
Sep 25, 2024
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
31 changes: 30 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
run: nix develop -i -L .#stable --command cargo test ${{ matrix.build-args }}

itest:
name: "Integration tests"
name: "Integration regtest tests"
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -102,6 +102,35 @@ jobs:
run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
- name: Test
run: nix develop -i -L .#stable --command just itest ${{ matrix.database }}

fake-wallet-itest:
name: "Integration fake wallet tests"
runs-on: ubuntu-latest
strategy:
matrix:
build-args:
[
-p cdk-integration-tests,
]
database:
[
REDB,
SQLITE,
MEMORY
]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v11
- name: Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Clippy
run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
- name: Test fake mint
run: nix develop -i -L .#stable --command just fake-mint-itest ${{ matrix.database }}

msrv-build:
name: "MSRV build"
Expand Down
19 changes: 1 addition & 18 deletions crates/cdk-axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use axum::Router;
use cdk::cdk_lightning::{self, MintLightning};
use cdk::mint::Mint;
use cdk::mint_url::MintUrl;
use cdk::nuts::{CurrencyUnit, PaymentMethod};
use cdk::types::LnKey;
use router_handlers::*;

mod router_handlers;
Expand Down Expand Up @@ -66,20 +66,3 @@ pub struct MintState {
mint_url: MintUrl,
quote_ttl: u64,
}

/// Key used in hashmap of ln backends to identify what unit and payment method
/// it is for
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct LnKey {
/// Unit of Payment backend
pub unit: CurrencyUnit,
/// Method of payment backend
pub method: PaymentMethod,
}

impl LnKey {
/// Create new [`LnKey`]
pub fn new(unit: CurrencyUnit, method: PaymentMethod) -> Self {
Self { unit, method }
}
}
Loading
Loading