Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
EthMethodsTest.php
Go to the documentation of this file.
1 <?php
2 namespace Ethereum;
5 
6 
13 {
14 
15  private $web3;
16 
17 
18  public function __construct(
19  ?string $name = null,
20  array $data = [],
21  string $dataName = ''
22  ) {
23  parent::__construct($name, $data, $dataName);
24  $this->web3 = new Ethereum($_ENV['SERVER_URL']);
25  }
26 
31  public function test_eth_getBlockByNumber()
32  {
33 
34  $BlockNumber = 13;
35  $x = $this->web3->eth_getBlockByNumber(new EthBlockParam($BlockNumber), new EthB(true));
36  $this->assertSame($BlockNumber, $x->number->val());
37 
38  }
39 
40 }
__construct(?string $name=null, array $data=[], string $dataName='')
Definition: Abi.php:3