From 1072936f7b7b50d0e46fef3d62dc77039504007e Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 26 May 2025 09:39:11 +0000 Subject: [PATCH] new `BitcoinTwView` subclass --- mmgen/proto/btc/tw/addresses.py | 6 ++++-- mmgen/proto/btc/tw/txhistory.py | 4 +++- mmgen/proto/btc/tw/unspent.py | 3 ++- mmgen/proto/btc/tw/view.py | 16 ++++++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100755 mmgen/proto/btc/tw/view.py diff --git a/mmgen/proto/btc/tw/addresses.py b/mmgen/proto/btc/tw/addresses.py index 9bc097b1..aa116bdb 100755 --- a/mmgen/proto/btc/tw/addresses.py +++ b/mmgen/proto/btc/tw/addresses.py @@ -15,9 +15,11 @@ proto.btc.tw.addresses: Bitcoin base protocol tracking wallet address list class from ....tw.addresses import TwAddresses from ....tw.shared import TwLabel from ....obj import get_obj -from .rpc import BitcoinTwRPC -class BitcoinTwAddresses(TwAddresses, BitcoinTwRPC): +from .rpc import BitcoinTwRPC +from .view import BitcoinTwView + +class BitcoinTwAddresses(BitcoinTwView, TwAddresses, BitcoinTwRPC): has_age = True has_used = True diff --git a/mmgen/proto/btc/tw/txhistory.py b/mmgen/proto/btc/tw/txhistory.py index 7118bdac..f5b5847d 100755 --- a/mmgen/proto/btc/tw/txhistory.py +++ b/mmgen/proto/btc/tw/txhistory.py @@ -19,7 +19,9 @@ from ....addr import CoinAddr from ....util import msg, msg_r from ....color import nocolor, red, pink, gray from ....obj import TwComment, CoinTxID, Int + from .rpc import BitcoinTwRPC +from .view import BitcoinTwView class BitcoinTwTransaction: @@ -238,7 +240,7 @@ class BitcoinTwTransaction: self.fee.to_unit(atomic_unit) // self.vsize, atomic_unit))) -class BitcoinTwTxHistory(TwTxHistory, BitcoinTwRPC): +class BitcoinTwTxHistory(BitcoinTwView, TwTxHistory, BitcoinTwRPC): has_age = True hdr_lbl = 'transaction history' diff --git a/mmgen/proto/btc/tw/unspent.py b/mmgen/proto/btc/tw/unspent.py index 5352b6c6..9df8e242 100755 --- a/mmgen/proto/btc/tw/unspent.py +++ b/mmgen/proto/btc/tw/unspent.py @@ -13,8 +13,9 @@ proto.btc.tw.unspent: Bitcoin base protocol tracking wallet unspent outputs clas """ from ....tw.unspent import TwUnspentOutputs +from .view import BitcoinTwView -class BitcoinTwUnspentOutputs(TwUnspentOutputs): +class BitcoinTwUnspentOutputs(BitcoinTwView, TwUnspentOutputs): class display_type(TwUnspentOutputs.display_type): diff --git a/mmgen/proto/btc/tw/view.py b/mmgen/proto/btc/tw/view.py new file mode 100755 index 00000000..de15e1d1 --- /dev/null +++ b/mmgen/proto/btc/tw/view.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# +# MMGen Wallet, a terminal-based cryptocurrency wallet +# Copyright (C)2013-2025 The MMGen Project +# Licensed under the GNU General Public License, Version 3: +# https://www.gnu.org/licenses +# Public project repositories: +# https://github.com/mmgen/mmgen-wallet +# https://gitlab.com/mmgen/mmgen-wallet + +""" +proto.btc.tw.view: Bitcoin base protocol base class for tracking wallet view classes +""" + +class BitcoinTwView: + pass