Ethereum PHP
PHP interface to Ethereum JSON-RPC API.
RlpTest.php
Go to the documentation of this file.
1 <?php
2 namespace Ethereum;
3 
5 
11 class RlpTest extends TestStatic {
12 
13 
25  public function rlpDataProvider() {
26  return [
27  // Array (AbiType, RLP value , RLP type, value)
28 
29  // @todo MORE TESTS. See also MultiReturnerTest.php
30 
31  [
32  'bytes',
33  '00000000000000000000000000000000000000000000000000000000000000036162630000000000000000000000000000000000000000000000000000000000',
34  'PREF_SHORT_ITEM',
35  '616263'
36  ],
37  [
38  'bytes',
39  '000000000000000000000000000000000000000000000000000000000000003c61626361626361626363616263616263616263636162636162636162636361626361626361626363616263616263616263636162636162636162636300000000',
40  'PREF_LONG_ITEM', // 0x20 should be short, but it's > 55bytes ???
41  '616263616263616263636162636162636162636361626361626361626363616263616263616263636162636162636162636361626361626361626363'
42  ],
43  ];
44  }
45 
46 
55  public function testUtf8ToMessage($abiType, $rlpValue, $rlpType, $value)
56  {
57  $test = Rlp::decode($rlpValue);
58  $AAA = $test[0]->get();
59  $this->assertSame($AAA, $value);
60  }
61 
62 }
testUtf8ToMessage($abiType, $rlpValue, $rlpType, $value)
Definition: RlpTest.php:55
Definition: Abi.php:3