Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions nemesis-generator/generator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def attach_signature(payload, signature):
writer.write_bytes(payload[:ENTITY_HEADER_SIZE])
writer.write_int(Signature.SIZE, 4)
writer.write_bytes(signature.bytes)

writer.write_bytes(payload[ENTITY_HEADER_SIZE:])
return writer.buffer

Expand Down Expand Up @@ -97,18 +96,19 @@ def prepare_block(self):
writer.write_int(0xFFFFFFFF, 4) # type
self._write_entity_header(writer)

writer.write_int(Hash256.SIZE + 4, 4)
writer.write_int(Hash256.SIZE + 4, 4) # needed to deserialize the previous block hash object
writer.write_int(Hash256.SIZE, 4)
writer.write_bytes(self.generation_hash.bytes)
previous_block_hash = Hash256.zero()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would move this to init

writer.write_bytes(previous_block_hash.bytes)

writer.write_int(1, 8) # height

writer.write_int(len(self.unsigned_transaction_payloads), 4) # transactions count
writer.write_int(len(self.signed_transaction_payloads), 4) # transactions count

unsigned_block_header = writer.buffer[:]

for unsigned_transaction_payload in self.unsigned_transaction_payloads:
writer.write_bytes(unsigned_transaction_payload)
for signed_transaction_payload in self.signed_transaction_payloads:
writer.write_bytes(signed_transaction_payload)

unsigned_block = writer.buffer
signature = self.signer_key_pair.sign(unsigned_block)
Expand Down
4 changes: 2 additions & 2 deletions nemesis-generator/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PyYAML==6.0
symbol-sdk-python==3.0.7
PyYAML==6.0.2
symbol-sdk-python==3.2.3
zenlog==1.1