コード例 #1
0
ファイル: Base.php プロジェクト: groupcash/php
 /**
  * @param Binary $currency
  * @param string $description
  * @param Output $output
  * @param Binary $issuerAddress
  * @param string $signature
  */
 public function __construct(Binary $currency, $description, Output $output, Binary $issuerAddress, $signature)
 {
     parent::__construct([], [$output], $signature);
     $this->description = $description;
     $this->currency = $currency;
     $this->issuerAddress = $issuerAddress;
 }
コード例 #2
0
ファイル: Verification.php プロジェクト: groupcash/php
 private function outputsExist(Transaction $transaction)
 {
     $exists = true;
     foreach ($transaction->getInputs() as $input) {
         if (!array_key_exists($input->getOutputIndex(), $input->getTransaction()->getOutputs())) {
             $this->errors[] = 'Invalid output index';
             $exists = false;
         }
     }
     return $exists;
 }
コード例 #3
0
ファイル: Coin.php プロジェクト: groupcash/php
 private function getBasesOf(Transaction $transaction)
 {
     if ($transaction instanceof Base) {
         return [$transaction];
     }
     $bases = [];
     foreach ($transaction->getInputs() as $input) {
         $bases = array_merge($bases, $this->getBasesOf($input->getTransaction()));
     }
     return $bases;
 }
コード例 #4
0
ファイル: Confirmation.php プロジェクト: groupcash/php
 /**
  * @param Base[] $bases
  * @param Output $output
  * @param Binary $hash
  * @param string $signature
  */
 public function __construct(array $bases, Output $output, Binary $hash, $signature)
 {
     parent::__construct(array_map([$this, 'makeInput'], $bases), $this->keepChange($bases, $output), $signature);
     $this->hash = $hash;
 }