fix: remove user from model (#1067)
This commit is contained in:
parent
9de38f908b
commit
daf5768d52
3 changed files with 3 additions and 5 deletions
|
|
@ -10,7 +10,7 @@ from .models import Address, Config, WalletAccount
|
||||||
##########################WALLETS####################
|
##########################WALLETS####################
|
||||||
|
|
||||||
|
|
||||||
async def create_watch_wallet(w: WalletAccount) -> WalletAccount:
|
async def create_watch_wallet(user: str, w: WalletAccount) -> WalletAccount:
|
||||||
wallet_id = urlsafe_short_hash()
|
wallet_id = urlsafe_short_hash()
|
||||||
await db.execute(
|
await db.execute(
|
||||||
"""
|
"""
|
||||||
|
|
@ -30,7 +30,7 @@ async def create_watch_wallet(w: WalletAccount) -> WalletAccount:
|
||||||
""",
|
""",
|
||||||
(
|
(
|
||||||
wallet_id,
|
wallet_id,
|
||||||
w.user,
|
user,
|
||||||
w.masterpub,
|
w.masterpub,
|
||||||
w.fingerprint,
|
w.fingerprint,
|
||||||
w.title,
|
w.title,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ class CreateWallet(BaseModel):
|
||||||
|
|
||||||
class WalletAccount(BaseModel):
|
class WalletAccount(BaseModel):
|
||||||
id: str
|
id: str
|
||||||
user: str
|
|
||||||
masterpub: str
|
masterpub: str
|
||||||
fingerprint: str
|
fingerprint: str
|
||||||
title: str
|
title: str
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,6 @@ async def api_wallet_create_or_update(
|
||||||
|
|
||||||
new_wallet = WalletAccount(
|
new_wallet = WalletAccount(
|
||||||
id="none",
|
id="none",
|
||||||
user=w.wallet.user,
|
|
||||||
masterpub=data.masterpub,
|
masterpub=data.masterpub,
|
||||||
fingerprint=descriptor.keys[0].fingerprint.hex(),
|
fingerprint=descriptor.keys[0].fingerprint.hex(),
|
||||||
type=descriptor.scriptpubkey_type(),
|
type=descriptor.scriptpubkey_type(),
|
||||||
|
|
@ -115,7 +114,7 @@ async def api_wallet_create_or_update(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
wallet = await create_watch_wallet(new_wallet)
|
wallet = await create_watch_wallet(w.wallet.user, new_wallet)
|
||||||
|
|
||||||
await api_get_addresses(wallet.id, w)
|
await api_get_addresses(wallet.id, w)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue