Exemple #1
0
 /**
  * @param string $description
  * @param Binary $currency
  * @param Output $output
  * @param Signer $signer
  * @return Coin
  */
 public static function issue($description, Binary $currency, Output $output, Signer $signer)
 {
     return new Coin(new Input(Base::signedBase($description, $currency, $output, $signer), 0));
 }
Exemple #2
0
 private function BaseToArray(Base $base, Transcoder $transcoder)
 {
     return ['in' => $transcoder->encode($base->getCurrency()->getData()), 'that' => $base->getDescription(), 'out' => $this->OutputToArray($base->getOutput(), $transcoder), 'by' => $transcoder->encode($base->getIssuerAddress()->getData()), 'sig' => $base->getSignature()];
 }
Exemple #3
0
 private function verifyBaseSignature(Base $transaction)
 {
     $issuer = $transaction->getIssuerAddress();
     if (!$this->key->verify(Signer::squash($transaction), $issuer, $transaction->getSignature())) {
         $this->errors[] = "Invalid signature by [{$issuer}]";
     }
 }