コード例 #1
0
ファイル: Verification.php プロジェクト: groupcash/php
 private function consistentCurrencies(Coin $coin)
 {
     $currencies = array_unique(array_map(function (Base $base) {
         return $base->getCurrency();
     }, $coin->getBases()));
     if (count($currencies) > 1) {
         $this->errors[] = 'Inconsistent currencies: [' . implode('], [', $currencies) . ']';
     }
 }
コード例 #2
0
ファイル: CoinTransformer.php プロジェクト: groupcash/php
 private function CoinToArray(Coin $coin, Transcoder $transcoder)
 {
     return ['v' => $coin->version(), 'coin' => $this->InputToArray($coin->getInput(), $transcoder)];
 }
コード例 #3
0
ファイル: Groupcash.php プロジェクト: groupcash/php
 /**
  * Creates a new coin with a value proportional to the bases of the backer.
  *
  * @param Binary $backerKey
  * @param Coin $coin
  * @return Coin
  * @throws \Exception
  */
 public function confirmCoin(Binary $backerKey, Coin $coin)
 {
     $backer = $this->key->getAddress($backerKey);
     $confirmed = $coin->confirm($backer, new Signer($this->key, $backerKey));
     (new Verification($this->key))->verify($confirmed)->mustBeOk();
     return $confirmed;
 }