Ejemplo n.º 1
0
 def setUp(self) -> None:
     self.trx = Transaction(123, [Output(100, TEST_PUBADDR).id], [Output(10, TEST_PUBADDR), Output(90, TEST_PUBADDR)])
     self.trx.sign(Privkey.from_pem(io.StringIO(PEM_FILE_DATA)))
     # self.blk = Block(345, GENESIS_BLOCK, [self.trx.id])
     self.blk = Block(345, GENESIS_BLOCK, [self.trx])
Ejemplo n.º 2
0
 def block_assemble_new(self, trxs_new: List[Transaction]) -> Block:
     logger.debug('assembling new block')
     # coinbase trx
     coinbase = Utils.coinbase_transaction()
     blk_new = Block(time(), self.__ledger[-1], [coinbase, *trxs_new])
     return blk_new