-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
395da3f
commit 25c3c3e
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -x | ||
script_dir=$(dirname -- "$(readlink -f -- "$0")") | ||
cargo_toml_path="$script_dir/../Cargo.toml" | ||
|
||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
cargo build --manifest-path="$cargo_toml_path" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/python | ||
|
||
from pyln.testing.fixtures import * # noqa: F403 | ||
from util import get_plugin # noqa: F401 | ||
|
||
|
||
def test_basic(node_factory, get_plugin): # noqa: F811 | ||
node = node_factory.get_node( | ||
options={ | ||
"plugin": get_plugin, | ||
"ntfy-url": "https://ntfy.sh", | ||
"ntfy-topic": "cln-alerts", | ||
"ntfy-username": "username", | ||
"ntfy-password": "password", | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import logging | ||
import os | ||
import random | ||
import string | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
RUST_PROFILE = os.environ.get("RUST_PROFILE", "debug") | ||
COMPILED_PATH = Path.cwd() / "target" / RUST_PROFILE / "cln-ntfy" | ||
DOWNLOAD_PATH = Path.cwd() / "tests" / "cln-ntfy" | ||
|
||
|
||
@pytest.fixture | ||
def get_plugin(directory): | ||
if COMPILED_PATH.is_file(): | ||
return COMPILED_PATH | ||
elif DOWNLOAD_PATH.is_file(): | ||
return DOWNLOAD_PATH | ||
else: | ||
raise ValueError("No files were found.") | ||
|
||
|
||
def generate_random_label(): | ||
label_length = 8 | ||
random_label = "".join( | ||
random.choice(string.ascii_letters) for _ in range(label_length) | ||
) | ||
return random_label | ||
|
||
|
||
def generate_random_number(): | ||
return random.randint(1, 20_000_000_000_000_00_000) | ||
|
||
|
||
def pay_with_thread(rpc, bolt11): | ||
LOGGER = logging.getLogger(__name__) | ||
try: | ||
rpc.dev_pay(bolt11, dev_use_shadow=False) | ||
except Exception as e: | ||
LOGGER.debug(f"Error paying payment hash:{e}") | ||
pass |