choose endpoint

This commit is contained in:
callebtc
2022-09-11 15:59:10 +03:00
parent 767c8c30fc
commit f86daa946f
2 changed files with 6 additions and 5 deletions

7
cashu
View File

@@ -8,8 +8,6 @@ import json
import base64
from bech32 import bech32_encode, bech32_decode, convertbits
SERVER_ENDPOINT = "http://localhost:5000"
import asyncio
from functools import wraps
@@ -25,14 +23,15 @@ def coro(f):
@click.command("mint")
@click.option("--host", default="http://localhost:5000", help="Mint tokens.")
@click.option("--wallet", default="wallet", help="Mint tokens.")
@click.option("--mint", default=0, help="Mint tokens.")
@click.option("--send", default=0, help="Send tokens.")
@click.option("--receive", default="", help="Receive tokens.")
@click.option("--invalidate", default="", help="Invalidate tokens.")
@coro
async def main(wallet, mint, send, receive, invalidate):
wallet = Wallet(SERVER_ENDPOINT, f"data/{wallet}")
async def main(host, wallet, mint, send, receive, invalidate):
wallet = Wallet(host, f"data/{wallet}")
await m001_initial(db=wallet.db)
await wallet.load_proofs()
if mint:

View File

@@ -6,8 +6,10 @@ from wallet.wallet import Wallet as Wallet2
from wallet.migrations import m001_initial
SERVER_ENDPOINT = "http://localhost:5000"
async def run_test():
SERVER_ENDPOINT = "http://localhost:5000"
wallet1 = Wallet1(SERVER_ENDPOINT, "data/wallet1")
await m001_initial(wallet1.db)
wallet1.status()