Block.php 442 B

123456789101112131415161718192021
  1. <?php
  2. namespace Tron;
  3. class Block
  4. {
  5. public $blockID;
  6. public $block_header;
  7. public $transactions;
  8. public function __construct(string $blockID, array $block_header, array $transactions = [])
  9. {
  10. if (!strlen($blockID)) {
  11. throw new \Exception('blockID empty');
  12. }
  13. $this->blockID = $blockID;
  14. $this->block_header = $block_header;
  15. $this->transactions = $transactions;
  16. }
  17. }