Skip to content

Commit

Permalink
feat: check outgoing payment status flow
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Sep 25, 2024
1 parent a87117f commit 5139c47
Show file tree
Hide file tree
Showing 38 changed files with 1,676 additions and 338 deletions.
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

0 comments on commit 5139c47

Please sign in to comment.