|
@@ -15,7 +15,7 @@ tx.info: transaction info class
|
|
|
import importlib
|
|
import importlib
|
|
|
|
|
|
|
|
from ..cfg import gc
|
|
from ..cfg import gc
|
|
|
-from ..color import red, green, orange
|
|
|
|
|
|
|
+from ..color import red, green, cyan, orange
|
|
|
from ..util import msg, msg_r, decode_timestamp, make_timestr
|
|
from ..util import msg, msg_r, decode_timestamp, make_timestr
|
|
|
from ..util2 import format_elapsed_hr
|
|
from ..util2 import format_elapsed_hr
|
|
|
|
|
|
|
@@ -51,6 +51,7 @@ class TxInfo:
|
|
|
|
|
|
|
|
def gen_view():
|
|
def gen_view():
|
|
|
yield (self.txinfo_hdr_fs_short if terse else self.txinfo_hdr_fs).format(
|
|
yield (self.txinfo_hdr_fs_short if terse else self.txinfo_hdr_fs).format(
|
|
|
|
|
+ hdr = cyan('TRANSACTION DATA'),
|
|
|
i = tx.txid.hl(),
|
|
i = tx.txid.hl(),
|
|
|
a = tx.send_amt.hl(),
|
|
a = tx.send_amt.hl(),
|
|
|
c = tx.dcoin,
|
|
c = tx.dcoin,
|
|
@@ -63,19 +64,19 @@ class TxInfo:
|
|
|
for attr, label in [('timestamp', 'Created:'), ('sent_timestamp', 'Sent:')]:
|
|
for attr, label in [('timestamp', 'Created:'), ('sent_timestamp', 'Sent:')]:
|
|
|
if (val := getattr(tx, attr)) is not None:
|
|
if (val := getattr(tx, attr)) is not None:
|
|
|
_ = decode_timestamp(val)
|
|
_ = decode_timestamp(val)
|
|
|
- yield f'{label:8} {make_timestr(_)} ({format_elapsed_hr(_)})\n'
|
|
|
|
|
|
|
+ yield f' {label:8} {make_timestr(_)} ({format_elapsed_hr(_)})\n'
|
|
|
|
|
|
|
|
if tx.chain != 'mainnet': # if mainnet has a coin-specific name, display it
|
|
if tx.chain != 'mainnet': # if mainnet has a coin-specific name, display it
|
|
|
- yield green(f'Chain: {tx.chain.upper()}') + '\n'
|
|
|
|
|
|
|
+ yield green(f' Chain: {tx.chain.upper()}') + '\n'
|
|
|
|
|
|
|
|
if tx.coin_txid:
|
|
if tx.coin_txid:
|
|
|
- yield f'{tx.coin} TxID: {tx.coin_txid.hl()}\n'
|
|
|
|
|
|
|
+ yield f' {tx.coin} TxID: {tx.coin_txid.hl()}\n'
|
|
|
|
|
|
|
|
enl = ('\n', '')[bool(terse)]
|
|
enl = ('\n', '')[bool(terse)]
|
|
|
yield enl
|
|
yield enl
|
|
|
|
|
|
|
|
if tx.comment:
|
|
if tx.comment:
|
|
|
- yield f'Comment: {tx.comment.hl()}\n{enl}'
|
|
|
|
|
|
|
+ yield f' Comment: {tx.comment.hl()}\n{enl}'
|
|
|
|
|
|
|
|
yield self.format_body(
|
|
yield self.format_body(
|
|
|
blockcount,
|
|
blockcount,
|
|
@@ -124,6 +125,7 @@ class TxInfo:
|
|
|
from ..ui import do_pager
|
|
from ..ui import do_pager
|
|
|
do_pager(o)
|
|
do_pager(o)
|
|
|
else:
|
|
else:
|
|
|
|
|
+ msg('')
|
|
|
msg_r(o)
|
|
msg_r(o)
|
|
|
from ..term import get_char
|
|
from ..term import get_char
|
|
|
if pause:
|
|
if pause:
|