Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
EthBlockParamTest.php
Go to the documentation of this file.
1 <?php
2 namespace Ethereum;
3 
6 
13 {
18  public function testEthBlockParam__address()
19  {
20 
21  $x = new EthBlockParam('0x3facfa472e86e3edaeaa837f6ba038ac01f7f539');
22  $this->assertSame($x->val(), '363523949029425027178585641663023053417725031737');
23  $this->assertSame($x->hexVal(), '0x3facfa472e86e3edaeaa837f6ba038ac01f7f539');
24 
25 
26  $x = new EthBlockParam('0x3facfa472e86e3edaeaa837f6ba038ac01f7f539');
27  $this->assertSame($x->val(), '363523949029425027178585641663023053417725031737');
28  $this->assertSame($x->hexVal(), '0x3facfa472e86e3edaeaa837f6ba038ac01f7f539');
29  $this->assertSame($x->getSchemaType(), "Q|T");
30  }
31 
32  public function testEthBlockParam__tagLatest()
33  {
34 
35  $x = new EthBlockParam('latest');
36  $this->assertSame($x->val(), 'latest');
37  $this->assertSame($x->hexVal(), 'latest');
38  }
39 
41  {
42 
43  $x = new EthBlockParam('pending');
44  $this->assertSame($x->val(), 'pending');
45  $this->assertSame($x->hexVal(), 'pending');
46  }
47 
49  {
50 
51  $x = new EthBlockParam('earliest');
52  $this->assertSame($x->val(), 'earliest');
53  $this->assertSame($x->hexVal(), 'earliest');
54  }
55 }
Definition: Abi.php:3