mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 10:05:29 -05:00
CHIA-4339 Annotate wallet_interested_store.py (#21222)
Annotate wallet_interested_store.py.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from chia_rs import CoinState
|
from chia_rs import CoinState
|
||||||
from chia_rs.sized_bytes import bytes32
|
from chia_rs.sized_bytes import bytes32
|
||||||
from chia_rs.sized_ints import uint32
|
from chia_rs.sized_ints import uint32
|
||||||
@@ -15,7 +17,7 @@ class WalletInterestedStore:
|
|||||||
db_wrapper: DBWrapper2
|
db_wrapper: DBWrapper2
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def create(cls, wrapper: DBWrapper2):
|
async def create(cls, wrapper: DBWrapper2) -> WalletInterestedStore:
|
||||||
self = cls()
|
self = cls()
|
||||||
self.db_wrapper = wrapper
|
self.db_wrapper = wrapper
|
||||||
|
|
||||||
@@ -67,7 +69,7 @@ class WalletInterestedStore:
|
|||||||
row = await cursor.fetchone()
|
row = await cursor.fetchone()
|
||||||
if row is None:
|
if row is None:
|
||||||
return None
|
return None
|
||||||
return row[0]
|
return int(row[0])
|
||||||
|
|
||||||
async def add_interested_puzzle_hash(self, puzzle_hash: bytes32, wallet_id: int) -> None:
|
async def add_interested_puzzle_hash(self, puzzle_hash: bytes32, wallet_id: int) -> None:
|
||||||
async with self.db_wrapper.writer_maybe_transaction() as conn:
|
async with self.db_wrapper.writer_maybe_transaction() as conn:
|
||||||
@@ -110,7 +112,7 @@ class WalletInterestedStore:
|
|||||||
)
|
)
|
||||||
await cursor.close()
|
await cursor.close()
|
||||||
|
|
||||||
async def get_unacknowledged_tokens(self) -> list:
|
async def get_unacknowledged_tokens(self) -> list[dict[str, Any]]:
|
||||||
"""
|
"""
|
||||||
Get a list of all unacknowledged CATs
|
Get a list of all unacknowledged CATs
|
||||||
:return: A json style list of unacknowledged CATs
|
:return: A json style list of unacknowledged CATs
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ chia.types.blockchain_format.program
|
|||||||
chia.wallet.puzzles.load_clvm
|
chia.wallet.puzzles.load_clvm
|
||||||
chia.wallet.util.debug_spend_bundle
|
chia.wallet.util.debug_spend_bundle
|
||||||
chia.wallet.util.new_peak_queue
|
chia.wallet.util.new_peak_queue
|
||||||
chia.wallet.wallet_interested_store
|
|
||||||
chia.wallet.wallet_transaction_store
|
chia.wallet.wallet_transaction_store
|
||||||
chia._tests.clvm.test_puzzles
|
chia._tests.clvm.test_puzzles
|
||||||
chia._tests.clvm.test_singletons
|
chia._tests.clvm.test_singletons
|
||||||
|
|||||||
Reference in New Issue
Block a user