diff --git a/chainlib/eth/tx.py b/chainlib/eth/tx.py index 9079811..28ff167 100644 --- a/chainlib/eth/tx.py +++ b/chainlib/eth/tx.py @@ -210,10 +210,11 @@ class Tx: def apply_receipt(self, rcpt): - if rcpt['status'] == 1: + status_number = int(strip_0x(rcpt['status'])) + if status_number == 1: self.status = Status.SUCCESS - elif rcpt['status'] == 0: - self.status = Status.PENDING + elif status_number == 0: + self.status = Status.ERROR self.logs = rcpt['logs'] @@ -222,13 +223,17 @@ class Tx: def __str__(self): - return """from {} + return """hash {} +from {} to {} value {} nonce {} gasPrice {} gasLimit {} -input {}""".format( +input {} +status {} +""".format( + self.hash, self.outputs[0], self.inputs[0], self.value, @@ -236,4 +241,5 @@ input {}""".format( self.gasPrice, self.gasLimit, self.payload, + self.status.name, ) diff --git a/setup.cfg b/setup.cfg index e9b8f4e..0721d6d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = chainlib -version = 0.0.1a17 +version = 0.0.1a18 description = Generic blockchain access library and tooling author = Louis Holbrook author_email = dev@holbrook.no