Пример #1
0
 /**
  * @depends testSerializationDeserialization
  * @param AddressBalance $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getAddress(), "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD");
     $this->assertEquals($obj->getTotalReceived(), 4433416);
     $this->assertEquals($obj->getTotalSent(), 0);
     $this->assertEquals($obj->getBalance(), 4433416);
     $this->assertEquals($obj->getUnconfirmedBalance(), 0);
     $this->assertEquals($obj->getFinalBalance(), 4433416);
     $this->assertEquals($obj->getNTx(), 7);
     $this->assertEquals($obj->getUnconfirmedNTx(), 0);
     $this->assertEquals($obj->getFinalNTx(), 7);
 }
 /**
  * @param Address $address
  * @param BlockCypherAddressBalance $blockCypherAddressBalance
  * @param string $apiUrl
  * @param string $explorerUrl
  * @return $this
  */
 public static function from(Address $address, BlockCypherAddressBalance $blockCypherAddressBalance, $apiUrl, $explorerUrl)
 {
     $addressListItemDto = new self();
     $addressListItemDto->setAddress($address->getAddress());
     $addressListItemDto->setTag($address->getTag());
     $addressListItemDto->setCreationTime($address->getCreationTime());
     $addressListItemDto->setFinalBalance($blockCypherAddressBalance->getFinalBalance());
     $addressListItemDto->setNTx($blockCypherAddressBalance->getNTx());
     $addressListItemDto->setApiUrl($apiUrl);
     $addressListItemDto->setExplorerUrl($explorerUrl);
     return $addressListItemDto;
 }