chainlib

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

commit 63df6aa6c4eaca128919c80231edeefff37c4bb8
parent 11b7c4e4e86be157cddbf7a1aa1b90c6775e4dfa
Author: lash <dev@holbrook.no>
Date:   Tue, 10 May 2022 19:00:37 +0000

Fix wire generation bug

Diffstat:
MCHANGELOG | 2++
Mchainlib/block.py | 4++--
Mchainlib/tx.py | 10++++------
Msetup.cfg | 2+-
4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,5 @@ +- 0.2.1 + * Fix bug in wire format generation for tx - 0.2.0 * Consolidate genertic blcok, tx and tx result objects - 0.1.3 diff --git a/chainlib/block.py b/chainlib/block.py @@ -19,7 +19,7 @@ class Block(Src): tx_generator = Tx - def __init__(self, src): + def __init__(self, src=None): self.number = None self.txs = [] self.author = None @@ -27,7 +27,7 @@ class Block(Src): self.get_tx = self.tx_index_by_hash self.tx = self.tx_by_index - super(Block, self).__init__(src) + super(Block, self).__init__(src=src) def tx_by_index(self, idx): diff --git a/chainlib/tx.py b/chainlib/tx.py @@ -28,8 +28,6 @@ class Tx(Src): self.result = None - self.generate_wire = self.wire - super(Tx, self).__init__(src) if block != None: @@ -61,9 +59,9 @@ class Tx(Src): return self.result.status.name - def wire(self): - raise NotImplementedError() - + def generate_wire(self, chain_spec): + pass + def as_dict(self): raise NotImplementedError() @@ -78,7 +76,7 @@ class Tx(Src): class TxResult(Src): - def __init__(self, src): + def __init__(self, src=None): self.status = Status.UNKNOWN self.tx_index = None self.block_hash = None diff --git a/setup.cfg b/setup.cfg @@ -3,7 +3,7 @@ name=chainlib license=WTFPL2 author_email=dev@holbrook.no description=Generic blockchain access library and tooling -version=0.2.0 +version=0.2.1 url=https://gitlab.com/chaintools/chainlib author=Louis Holbrook