-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further refactoring including address- and txlist to wallet package
- Loading branch information
Kim Neunert
committed
Mar 24, 2023
1 parent
c3233b3
commit 964d4b9
Showing
16 changed files
with
210 additions
and
154 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
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
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
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
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
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
from .wallet import Wallet, purposes | ||
from .addresslist import Address | ||
from .txlist import WalletAwareTxItem |
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,27 @@ | ||
from .txlist import TxList | ||
import os | ||
from abc import ABC, abstractmethod | ||
|
||
|
||
class AbstractWallet: | ||
@property | ||
def transactions(self) -> TxList: | ||
if hasattr(self, "_transactions"): | ||
return self._transactions | ||
else: | ||
return None | ||
|
||
@property | ||
def addresses(self) -> TxList: | ||
if hasattr(self, "_addresses"): | ||
return self._addresses | ||
else: | ||
return None | ||
|
||
@property | ||
@abstractmethod | ||
def rpc(self): | ||
"""Cache RPC instance. Reuse if manager's RPC instance hasn't changed. Create new RPC instance otherwise. | ||
This RPC instance is also used by objects created by the wallet, such as TxList or TxItem | ||
""" | ||
pass |
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
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
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
Oops, something went wrong.