Skip to content

Commit cbd4c2d

Browse files
committed
feat: remove block conditional
1 parent 958106d commit cbd4c2d

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

hathor/transaction/base_transaction.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,12 @@ def serialize_output(tx: BaseTransaction, tx_out: TxOutput) -> dict[str, Any]:
820820
'parents': [],
821821
}
822822

823-
if not self.is_block:
824-
# A nano contract tx must be confirmed by one block at least
825-
# to be considered "executed"
826-
if meta.first_block is not None:
827-
ret['first_block'] = meta.first_block.hex()
828-
else:
829-
ret['first_block'] = None
823+
# A nano contract tx must be confirmed by one block at least
824+
# to be considered "executed"
825+
if meta.first_block is not None:
826+
ret['first_block'] = meta.first_block.hex()
827+
else:
828+
ret['first_block'] = None
830829

831830
for parent in self.parents:
832831
ret['parents'].append(parent.hex())

hathor/transaction/resources/dashboard.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ def render_GET(self, request):
192192
'script': 'dqkUixvdsajkV6vO+9Jjgjbaheqn016IrA=='
193193
}
194194
],
195-
'tokens': []
195+
'tokens': [],
196+
'first_block': ('000005af290a55b079014a0be3246479'
197+
'e84eeb635f02010dbf3e5f3414a85bbb')
196198
},
197199
{
198200
'tx_id': ('00035e46a20d0ecbda0dc6fdcaa243e9'
@@ -213,7 +215,9 @@ def render_GET(self, request):
213215
'script': 'dqkUdNQbj29Md1xsAYinK+RsDJCCB7eIrA=='
214216
}
215217
],
216-
'tokens': []
218+
'tokens': [],
219+
'first_block': ('000005af290a55b079014a0be3246479'
220+
'e84eeb635f02010dbf3e5f3414a85bbb')
217221
},
218222
{
219223
'tx_id': ('000133cc80b625b1babbd454edc3474e'
@@ -234,7 +238,8 @@ def render_GET(self, request):
234238
'script': 'dqkU0AoLEAX+1b36s+VyaMc9bkj/5byIrA=='
235239
}
236240
],
237-
'tokens': []
241+
'tokens': [],
242+
'first_block': None
238243
}
239244
]
240245
}

0 commit comments

Comments
 (0)