Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
FixUnpaddedValuesTest.php
Go to the documentation of this file.
1 <?php
2 namespace Ethereum;
3 
5 
14 {
15 
16  public function testMainNetTx() {
17  $web3 = new Ethereum('https://mainnet.infura.io/drupal');
18 
19  // @see https://etherscan.io/tx/0x527e9b670536c09fe160b0c2e33728eadd7f8affae7803049fa8d8ec2d1c7cfe
20  $mainNetTx = new EthD32('0x527e9b670536c09fe160b0c2e33728eadd7f8affae7803049fa8d8ec2d1c7cfe');
21  $transaction = $web3->eth_getTransactionByHash($mainNetTx);
22 
23  $this->assertSame(1.12208103, EthereumStatic::convertCurrency($transaction->value->val()));
24  }
25 
32  public function testMainNetTxReceipt() {
33  $web3 = new Ethereum('https://mainnet.infura.io/drupal');
34 
35  // @see https://etherscan.io/tx/0x527e9b670536c09fe160b0c2e33728eadd7f8affae7803049fa8d8ec2d1c7cfe
36  $mainNetTx = new EthD32('0xee04d9e2258909ca642acde0612597732f4ba244952e23eb83ecac3fe8dd5091');
37  $transaction = $web3->eth_getTransactionReceipt($mainNetTx);
38  $this->asserttrue(is_null($transaction->logs[0]->data));
39  }
40 }
41 
42 
43 
Definition: Abi.php:3