chainlib

Generic blockchain access library and tooling
Log | Files | Refs | README | LICENSE

commit b1cd745116d46f27406ff6c309530ea73757ad71
parent 290cbb3b2e1a32b05d54d359c0719f50948453fc
Author: lash <dev@holbrook.no>
Date:   Fri, 16 Dec 2022 09:02:05 +0000

Use object for dialect parsing across all child objects

Diffstat:
Mchainlib/block.py | 4----
Mchainlib/tx.py | 6+++++-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/chainlib/block.py b/chainlib/block.py @@ -38,10 +38,6 @@ class Block(Src): self.load_src(dialect_filter=dialect_filter) - def load_src(self, dialect_filter=None): - raise NotImplementedError() - - def tx_by_index(self, idx): """Return transaction object for transaction data at given index. diff --git a/chainlib/tx.py b/chainlib/tx.py @@ -30,6 +30,8 @@ class Tx(Src): super(Tx, self).__init__(src, dialect_filter=dialect_filter) + self.load_src(dialect_filter=dialect_filter) + if block != None: self.apply_block(block, dialect_filter=dialect_filter) @@ -76,9 +78,11 @@ class Tx(Src): class TxResult(Src): - def __init__(self, src=None): + def __init__(self, src=None, dialect_filter=None): self.status = Status.UNKNOWN self.tx_index = None self.block_hash = None self.fee_cost = 0 super(TxResult, self).__init__(src=src) + + self.load_src(dialect_filter=dialect_filter)