Esempio n. 1
0
 /**
  * @depends testSerializationDeserialization
  * @param TX $obj
  */
 public function testGetters($obj)
 {
     /** @noinspection SpellCheckingInspection */
     $addresses = array("13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy", "19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L", "1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy", "1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq", "1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV");
     /** @noinspection SpellCheckingInspection */
     $this->assertEquals($obj->getBlockHash(), "0000000000000000c504bdea36e531d8089d324f2d936c86e3274f97f8a44328");
     $this->assertEquals($obj->getBlockHeight(), "293000");
     /** @noinspection SpellCheckingInspection */
     $this->assertEquals($obj->getHash(), "f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449");
     $this->assertEquals($obj->getAddresses(), $addresses);
     $this->assertEquals($obj->getTotal(), 70320221545);
     $this->assertEquals($obj->getFees(), 0);
     $this->assertEquals($obj->getHex(), "010000000421f1708a507a4eb9df24eb1a8c0cb26298b5895ac2e5222e80ab90bfb7103958010000006b4830450220504b1ccfddf508422bdd8b0fcda2b1483e87aee1b486c0130bc29226bbce3b4e022100b5befcfcf0d3bf6ebf0ac2f93badb19e3042c7bed456c398e743b885e782466c012103b1feb40b99e8ff18469484a50e8b52cc478d5f4f773a341fbd920a4ceaedd4bfffffffffd9001d6c668de38a5e57eb3d1b4a0b3c793cb13f221bd17fb90ebad3b36b96f6240000006b48304502210086de855e03008abcc49335c775973eab9ace2e16c3bfe6536218c1d029287fdb0220129ced657870af63f61cdd4b941996f9a243d1f306e774fc9c5f3dea0af8d581012103cbe40d1d790799a6494c07f844eaf05b4c6deab0b9dee2ee45c8decead12c5cdffffffff88820c9edafa1938e32208169fa5778a67b4af66b9d8b09f3094665e69f9a29e010000006b48304502201f1eb5b79279258a91c00dee09dff5d6f6ece7c01639e66a6bdd579136ecddee022100d4a9ed93183bf338e51ba80bc1dd10ff03e9e159bd8ea59db3a5c10aa0ccd3400121022667ee37e180c1ad2fef6f16aa52ed27799f629364dfe51e144dd683317dbbd2ffffffff5d2d7404132ec7fe164b053360ee4619ec04fbe4f0e65fa8905360b8bacb9c27000000006b483045022100baac0c25867855f62592872cfac522d59fddd590a6cc290c8ad3bbe6b1151b5802204f2713c565ce6b00e5ea00e955d35e3b0878af5474feda35ebbb73232122d5480121023ed3b44ad598e3834e561efed205c221b7bc2e577e752eeaa66e85e60d0381c9ffffffff01696d695f100000001976a914e6aad9d712c419ea8febf009a3f3bfdd8d222fac88ac00000000");
     $this->assertEquals($obj->getPreference(), "low");
     $this->assertEquals($obj->getRelayedBy(), "");
     $this->assertEquals($obj->getConfirmed(), "2014-03-29T01:29:19Z");
     $this->assertEquals($obj->getReceived(), "2014-03-29T01:29:19Z");
     $this->assertEquals($obj->getVer(), 1);
     $this->assertEquals($obj->getLockTime(), 0);
     $this->assertEquals($obj->getDoubleSpend(), false);
     $this->assertEquals($obj->getDoubleOf(), "f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449");
     // Only if double_spend = true
     $this->assertEquals($obj->getReceiveCount(), 732);
     // Unconfirmed transactions only.
     $this->assertEquals($obj->getVinSz(), 4);
     $this->assertEquals($obj->getVoutSz(), 1);
     $this->assertEquals($obj->getConfirmations(), 59116);
     $this->assertEquals($obj->getConfidence(), 1);
     $this->assertEquals($obj->getGuaranteed(), true);
     $this->assertEquals($obj->getInputs(), array(TXInputTest::getObject()));
     $this->assertEquals($obj->getOutputs(), array(TXOutputTest::getObject()));
     $this->assertEquals($obj->getNextInputs(), "https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449?instart=2&outstart=1&limit=1");
     $this->assertEquals($obj->getNextOutputs(), "https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449?instart=2&outstart=1&limit=1");
 }
Esempio n. 2
0
 /**
  * @depends testSerializationDeserialization
  * @param MicroTX $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getFromPubkey(), "02d4e3404e175923adf89c932fab96758716f6a0a896890f2494c5d9141eb3f543");
     $this->assertEquals($obj->getFromPrivate(), "2c2cc015519b79782bd9c5af66f442e808f573714e3c4dc6df7d79c183963cff");
     /** @noinspection SpellCheckingInspection */
     $this->assertEquals($obj->getFromWif(), "BpouCdZ5dXbjcUDQBj8ZVYBbSPtWYDQHxuDcP48VA6Q7dZuqW4UJ");
     $this->assertEquals($obj->getToAddress(), "C4MYFr4EAdqEeUKxTnPUF3d3whWcPMz1Fi");
     $this->assertEquals($obj->getValueSatoshis(), 10000);
     /** @noinspection SpellCheckingInspection */
     $this->assertEquals($obj->getToken(), "c0afcccdde5081d6429de37d16166ead");
     $this->assertEquals($obj->getChangeAddress(), "C4MYFr4EAdqEeUKxTnPUF3d3whWcPMz1Fi");
     $this->assertEquals($obj->getWaitGuarantee(), true);
     /** @noinspection SpellCheckingInspection */
     $this->assertEquals($obj->getTosign(), array("488e6defc3f3d26a20505730a1c64b8a3499e225f1bbd8a0e1b51b38251eed0a"));
     /** @noinspection SpellCheckingInspection */
     $this->assertEquals($obj->getSignatures(), array("3045022100f99bef2add7d1fd9c771a530b8baf50fc080a95dc3c5abc4a9e520932ecaf2ca02204ab0ac7a9abf62470172eac9a9a285d711bb450026a15d6d64d8ae19ec090373"));
     $this->assertEquals($obj->getInputs(), array(TXInputTest::getObject()));
     $this->assertEquals($obj->getOutputs(), array(TXOutputTest::getObject()));
     $this->assertEquals($obj->getFees(), 735);
     $this->assertEquals($obj->getHash(), "7fc9e41e6ef29486bc4478ff063934ea9a1ecd08bbfb0a207b39ad92fe55bebf");
 }