EthApiTest.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. <?php
  2. namespace Test\Unit;
  3. use RuntimeException;
  4. use InvalidArgumentException;
  5. use Test\TestCase;
  6. use phpseclib\Math\BigInteger as BigNumber;
  7. class EthApiTest extends TestCase
  8. {
  9. /**
  10. * eth
  11. *
  12. * @var \Web3\Eth
  13. */
  14. protected $eth;
  15. /**
  16. * setUp
  17. *
  18. * @return void
  19. */
  20. public function setUp(): void
  21. {
  22. parent::setUp();
  23. $this->eth = $this->web3->eth;
  24. }
  25. /**
  26. * testProtocolVersion
  27. *
  28. * @return void
  29. */
  30. public function testProtocolVersion()
  31. {
  32. $eth = $this->eth;
  33. $eth->protocolVersion(function ($err, $version) {
  34. if ($err !== null) {
  35. return $this->fail($err->getMessage());
  36. }
  37. $this->assertTrue($version instanceof BigNumber);
  38. });
  39. }
  40. /**
  41. * testSyncing
  42. *
  43. * @return void
  44. */
  45. public function testSyncing()
  46. {
  47. $eth = $this->eth;
  48. $eth->syncing(function ($err, $syncing) {
  49. if ($err !== null) {
  50. return $this->fail($err->getMessage());
  51. }
  52. // due to the result might be object or bool, only test is null
  53. $this->assertTrue($syncing !== null);
  54. });
  55. }
  56. /**
  57. * testCoinbase
  58. *
  59. * @return void
  60. */
  61. public function testCoinbase()
  62. {
  63. $eth = $this->eth;
  64. $eth->coinbase(function ($err, $coinbase) {
  65. if ($err !== null) {
  66. return $this->fail($err->getMessage());
  67. }
  68. $this->assertEquals($coinbase, $this->coinbase);
  69. });
  70. }
  71. /**
  72. * testMining
  73. *
  74. * @return void
  75. */
  76. public function testMining()
  77. {
  78. $eth = $this->eth;
  79. $eth->mining(function ($err, $mining) {
  80. if ($err !== null) {
  81. return $this->fail($err->getMessage());
  82. }
  83. $this->assertTrue($mining);
  84. });
  85. }
  86. /**
  87. * testHashrate
  88. *
  89. * @return void
  90. */
  91. public function testHashrate()
  92. {
  93. $eth = $this->eth;
  94. $eth->hashrate(function ($err, $hashrate) {
  95. if ($err !== null) {
  96. return $this->fail($err->getMessage());
  97. }
  98. $this->assertEquals($hashrate->toString(), '0');
  99. });
  100. }
  101. /**
  102. * testGasPrice
  103. *
  104. * @return void
  105. */
  106. public function testGasPrice()
  107. {
  108. $eth = $this->eth;
  109. $eth->gasPrice(function ($err, $gasPrice) {
  110. if ($err !== null) {
  111. return $this->fail($err->getMessage());
  112. }
  113. $this->assertTrue(is_numeric($gasPrice->toString()));
  114. });
  115. }
  116. /**
  117. * testAccounts
  118. *
  119. * @return void
  120. */
  121. public function testAccounts()
  122. {
  123. $eth = $this->eth;
  124. $eth->accounts(function ($err, $accounts) {
  125. if ($err !== null) {
  126. return $this->fail($err->getMessage());
  127. }
  128. $this->assertTrue(is_array($accounts));
  129. });
  130. }
  131. /**
  132. * testBlockNumber
  133. *
  134. * @return void
  135. */
  136. public function testBlockNumber()
  137. {
  138. $eth = $this->eth;
  139. $eth->blockNumber(function ($err, $blockNumber) {
  140. if ($err !== null) {
  141. return $this->fail($err->getMessage());
  142. }
  143. $this->assertTrue(is_numeric($blockNumber->toString()));
  144. });
  145. }
  146. /**
  147. * testGetBalance
  148. *
  149. * @return void
  150. */
  151. public function testGetBalance()
  152. {
  153. $eth = $this->eth;
  154. $eth->getBalance('0x407d73d8a49eeb85d32cf465507dd71d507100c1', function ($err, $balance) {
  155. if ($err !== null) {
  156. return $this->fail($err->getMessage());
  157. }
  158. $this->assertTrue(is_numeric($balance->toString()));
  159. });
  160. }
  161. /**
  162. * testGetStorageAt
  163. *
  164. * @return void
  165. */
  166. public function testGetStorageAt()
  167. {
  168. $eth = $this->eth;
  169. $eth->getStorageAt('0x561a2aa10f9a8589c93665554c871106342f70af', '0x0', function ($err, $storage) {
  170. if ($err !== null) {
  171. return $this->fail($err->getMessage());
  172. }
  173. $this->assertTrue(is_string($storage));
  174. });
  175. }
  176. /**
  177. * testGetTransactionCount
  178. *
  179. * @return void
  180. */
  181. public function testGetTransactionCount()
  182. {
  183. $eth = $this->eth;
  184. $eth->getTransactionCount('0x561a2aa10f9a8589c93665554c871106342f70af', function ($err, $transactionCount) {
  185. if ($err !== null) {
  186. return $this->fail($err->getMessage());
  187. }
  188. $this->assertTrue(is_numeric($transactionCount->toString()));
  189. });
  190. }
  191. /**
  192. * testGetBlockTransactionCountByHash
  193. *
  194. * @return void
  195. */
  196. public function testGetBlockTransactionCountByHash()
  197. {
  198. $eth = $this->eth;
  199. $eth->getBlockTransactionCountByHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $transactionCount) {
  200. if ($err !== null) {
  201. return $this->assertEquals('Key not found in database', $err->getMessage());
  202. }
  203. $this->assertTrue(is_numeric($transactionCount->toString()));
  204. });
  205. }
  206. /**
  207. * testGetBlockTransactionCountByNumber
  208. *
  209. * @return void
  210. */
  211. public function testGetBlockTransactionCountByNumber()
  212. {
  213. $eth = $this->eth;
  214. $eth->getBlockTransactionCountByNumber('0x0', function ($err, $transactionCount) {
  215. if ($err !== null) {
  216. return $this->fail($err->getMessage());
  217. }
  218. $this->assertTrue(is_numeric($transactionCount->toString()));
  219. });
  220. }
  221. /**
  222. * testGetUncleCountByBlockHash
  223. *
  224. * @return void
  225. */
  226. public function testGetUncleCountByBlockHash()
  227. {
  228. $eth = $this->eth;
  229. $eth->getUncleCountByBlockHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $uncleCount) {
  230. if ($err !== null) {
  231. return $this->fail($err->getMessage());
  232. }
  233. $this->assertTrue(is_numeric($uncleCount->toString()));
  234. });
  235. }
  236. /**
  237. * testGetUncleCountByBlockNumber
  238. *
  239. * @return void
  240. */
  241. public function testGetUncleCountByBlockNumber()
  242. {
  243. $eth = $this->eth;
  244. $eth->getUncleCountByBlockNumber('0x0', function ($err, $uncleCount) {
  245. if ($err !== null) {
  246. return $this->fail($err->getMessage());
  247. }
  248. $this->assertTrue(is_numeric($uncleCount->toString()));
  249. });
  250. }
  251. /**
  252. * testGetCode
  253. *
  254. * @return void
  255. */
  256. public function testGetCode()
  257. {
  258. $eth = $this->eth;
  259. $eth->getCode('0x407d73d8a49eeb85d32cf465507dd71d507100c1', function ($err, $code) {
  260. if ($err !== null) {
  261. return $this->fail($err->getMessage());
  262. }
  263. $this->assertTrue(is_string($code));
  264. });
  265. }
  266. /**
  267. * testSign
  268. *
  269. * @return void
  270. */
  271. public function testSign()
  272. {
  273. $eth = $this->eth;
  274. $eth->sign('0x407d73d8a49eeb85d32cf465507dd71d507100c1', '0xdeadbeaf', function ($err, $sign) {
  275. if ($err !== null) {
  276. return $this->assertEquals('cannot sign data; no private key', $err->getMessage());
  277. }
  278. $this->assertTrue(is_string($sign));
  279. });
  280. }
  281. /**
  282. * testSendTransaction
  283. *
  284. * @return void
  285. */
  286. public function testSendTransaction()
  287. {
  288. $eth = $this->eth;
  289. $eth->sendTransaction([
  290. 'from' => "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
  291. 'to' => "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
  292. 'gas' => "0x76c0",
  293. 'gasPrice' => "0x9184e72a000",
  294. 'value' => "0x9184e72a",
  295. 'data' => "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
  296. ], function ($err, $transaction) {
  297. if ($err !== null) {
  298. return $this->assertEquals('sender account not recognized', $err->getMessage());
  299. }
  300. $this->assertTrue(is_string($transaction));
  301. });
  302. }
  303. /**
  304. * testSendRawTransaction
  305. *
  306. * @return void
  307. */
  308. public function testSendRawTransaction()
  309. {
  310. $eth = $this->eth;
  311. $eth->sendRawTransaction('0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675', function ($err, $transaction) {
  312. if ($err !== null) {
  313. return $this->assertStringContainsString('Could not ', $err->getMessage());
  314. }
  315. $this->assertTrue(is_string($transaction));
  316. });
  317. }
  318. /**
  319. * testCall
  320. *
  321. * @return void
  322. */
  323. public function testCall()
  324. {
  325. $eth = $this->eth;
  326. $eth->call([
  327. // 'from' => "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
  328. 'to' => "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
  329. 'gas' => "0x76c0",
  330. 'gasPrice' => "0x9184e72a000",
  331. 'value' => "0x9184e72a",
  332. 'data' => "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
  333. ], function ($err, $transaction) {
  334. if ($err !== null) {
  335. return $this->fail($err->getMessage());
  336. }
  337. $this->assertTrue(is_string($transaction));
  338. });
  339. }
  340. /**
  341. * testEstimateGas
  342. *
  343. * @return void
  344. */
  345. public function testEstimateGas()
  346. {
  347. $eth = $this->eth;
  348. $eth->estimateGas([
  349. 'from' => "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
  350. 'to' => "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
  351. 'gas' => "0x76c0",
  352. 'gasPrice' => "0x9184e72a000",
  353. 'value' => "0x9184e72a",
  354. 'data' => "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
  355. ], function ($err, $gas) {
  356. if ($err !== null) {
  357. return $this->fail($err->getMessage());
  358. }
  359. $this->assertTrue(is_numeric($gas->toString()));
  360. });
  361. }
  362. /**
  363. * testGetBlockByHash
  364. *
  365. * @return void
  366. */
  367. public function testGetBlockByHash()
  368. {
  369. $eth = $this->eth;
  370. $eth->getBlockByHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', false, function ($err, $block) {
  371. if ($err !== null) {
  372. return $this->assertEquals('Key not found in database', $err->getMessage());
  373. }
  374. $this->assertTrue($block === null);
  375. });
  376. }
  377. /**
  378. * testGetBlockByNumber
  379. *
  380. * @return void
  381. */
  382. public function testGetBlockByNumber()
  383. {
  384. $eth = $this->eth;
  385. $eth->getBlockByNumber('latest', false, function ($err, $block) {
  386. if ($err !== null) {
  387. return $this->fail($err->getMessage());
  388. }
  389. // weird behavior, see https://github.com/web3p/web3.php/issues/16
  390. $this->assertTrue($block !== null);
  391. });
  392. }
  393. /**
  394. * testGetTransactionByHash
  395. *
  396. * @return void
  397. */
  398. public function testGetTransactionByHash()
  399. {
  400. $eth = $this->eth;
  401. $eth->getTransactionByHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $transaction) {
  402. if ($err !== null) {
  403. return $this->fail($err->getMessage());
  404. }
  405. $this->assertTrue($transaction == null);
  406. });
  407. }
  408. /**
  409. * testGetTransactionByBlockHashAndIndex
  410. *
  411. * @return void
  412. */
  413. public function testGetTransactionByBlockHashAndIndex()
  414. {
  415. $eth = $this->eth;
  416. $eth->getTransactionByBlockHashAndIndex('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', '0x0', function ($err, $transaction) {
  417. if ($err !== null) {
  418. return $this->fail($err->getMessage());
  419. }
  420. $this->assertTrue($transaction == null);
  421. });
  422. }
  423. /**
  424. * testGetTransactionByBlockNumberAndIndex
  425. *
  426. * @return void
  427. */
  428. public function testGetTransactionByBlockNumberAndIndex()
  429. {
  430. $eth = $this->eth;
  431. $eth->getTransactionByBlockNumberAndIndex('0xe8', '0x0', function ($err, $transaction) {
  432. if ($err !== null) {
  433. return $this->assertStringStartsWith('LevelUpArrayAdapter named \'blocks\' index out of range', $err->getMessage());
  434. }
  435. $this->assertTrue($transaction === null);
  436. });
  437. }
  438. /**
  439. * testGetTransactionReceipt
  440. *
  441. * @return void
  442. */
  443. public function testGetTransactionReceipt()
  444. {
  445. $eth = $this->eth;
  446. $eth->getTransactionReceipt('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $transaction) {
  447. if ($err !== null) {
  448. return $this->fail($err->getMessage());
  449. }
  450. $this->assertTrue($transaction == null);
  451. });
  452. }
  453. /**
  454. * testGetUncleByBlockHashAndIndex
  455. *
  456. * @return void
  457. */
  458. public function testGetUncleByBlockHashAndIndex()
  459. {
  460. $eth = $this->eth;
  461. $eth->getUncleByBlockHashAndIndex('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', '0x0', function ($err, $uncle) {
  462. if ($err !== null) {
  463. return $this->fail($err->getMessage());
  464. }
  465. $this->assertTrue($uncle === null);
  466. });
  467. }
  468. /**
  469. * testGetUncleByBlockNumberAndIndex
  470. *
  471. * @return void
  472. */
  473. public function testGetUncleByBlockNumberAndIndex()
  474. {
  475. $eth = $this->eth;
  476. $eth->getUncleByBlockNumberAndIndex('0xe8', '0x0', function ($err, $uncle) {
  477. if ($err !== null) {
  478. return $this->fail($err->getMessage());
  479. }
  480. $this->assertTrue($uncle === null);
  481. });
  482. }
  483. /**
  484. * testNewFilter
  485. *
  486. * @return void
  487. */
  488. public function testNewFilter()
  489. {
  490. $eth = $this->eth;
  491. $eth->newFilter([
  492. 'fromBlock' => '0x1',
  493. 'toBlock' => '0x2',
  494. 'address' => '0x8888f1f195afa192cfee860698584c030f4c9db1',
  495. 'topics' => ['0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b', null, ['0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b', '0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc']]
  496. ], function ($err, $filter) {
  497. if ($err !== null) {
  498. // infura banned us to new filter
  499. return $this->fail($err->getMessage());
  500. }
  501. $this->assertTrue(is_string($filter));
  502. });
  503. }
  504. /**
  505. * testNewBlockFilter
  506. *
  507. * @return void
  508. */
  509. public function testNewBlockFilter()
  510. {
  511. $eth = $this->eth;
  512. $eth->newBlockFilter(function ($err, $filter) {
  513. if ($err !== null) {
  514. // infura banned us to new block filter
  515. return $this->fail($err->getMessage());
  516. }
  517. $this->assertTrue(is_string($filter));
  518. });
  519. }
  520. /**
  521. * testNewPendingTransactionFilter
  522. *
  523. * @return void
  524. */
  525. public function testNewPendingTransactionFilter()
  526. {
  527. $eth = $this->eth;
  528. $eth->newPendingTransactionFilter(function ($err, $filter) {
  529. if ($err !== null) {
  530. // infura banned us to new pending transaction filter
  531. return $this->fail($err->getMessage());
  532. }
  533. $this->assertTrue(is_string($filter));
  534. });
  535. }
  536. /**
  537. * testUninstallFilter
  538. *
  539. * @return void
  540. */
  541. public function testUninstallFilter()
  542. {
  543. $eth = $this->eth;
  544. $eth->uninstallFilter('0x01', function ($err, $filter) {
  545. if ($err !== null) {
  546. // infura banned us to uninstall filter
  547. return $this->fail($err->getMessage());
  548. }
  549. $this->assertTrue(is_bool($filter));
  550. });
  551. }
  552. /**
  553. * testGetFilterChanges
  554. *
  555. * @return void
  556. */
  557. public function testGetFilterChanges()
  558. {
  559. $eth = $this->eth;
  560. $eth->getFilterChanges('0x01', function ($err, $changes) {
  561. if ($err !== null) {
  562. return $this->assertEquals('filter not found', $err->getMessage());
  563. }
  564. $this->assertTrue(is_array($changes));
  565. });
  566. }
  567. /**
  568. * testGetFilterLogs
  569. *
  570. * @return void
  571. */
  572. public function testGetFilterLogs()
  573. {
  574. $eth = $this->eth;
  575. $eth->getFilterLogs('0x01', function ($err, $logs) {
  576. if ($err !== null) {
  577. return $this->assertEquals('filter not found', $err->getMessage());
  578. }
  579. $this->assertTrue(is_array($logs));
  580. });
  581. }
  582. /**
  583. * testGetLogs
  584. *
  585. * @return void
  586. */
  587. public function testGetLogs()
  588. {
  589. $eth = $this->eth;
  590. $eth->getLogs([
  591. 'fromBlock' => '0x1',
  592. 'toBlock' => '0x2',
  593. 'address' => '0x8888f1f195afa192cfee860698584c030f4c9db1',
  594. 'topics' => ['0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b', null, ['0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b', '0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc']]
  595. ], function ($err, $logs) {
  596. if ($err !== null) {
  597. return $this->fail($err->getMessage());
  598. }
  599. $this->assertTrue(is_array($logs));
  600. });
  601. }
  602. /**
  603. * testSubmitWork
  604. *
  605. * @return void
  606. */
  607. public function testSubmitWork()
  608. {
  609. $eth = $this->eth;
  610. $eth->submitWork(
  611. '0x0000000000000001',
  612. '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
  613. '0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000'
  614. , function ($err, $work) {
  615. if ($err !== null) {
  616. return $this->fail($err->getMessage());
  617. }
  618. $this->assertTrue(is_bool($work));
  619. });
  620. }
  621. /**
  622. * testSubmitHashrate
  623. *
  624. * @return void
  625. */
  626. public function testSubmitHashrate()
  627. {
  628. $eth = $this->eth;
  629. $eth->submitHashrate(
  630. '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
  631. '0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000'
  632. , function ($err, $work) {
  633. if ($err !== null) {
  634. return $this->fail($err->getMessage());
  635. }
  636. $this->assertTrue(is_bool($work));
  637. });
  638. }
  639. /**
  640. * testFeeHistory
  641. *
  642. * @return void
  643. */
  644. public function testFeeHistory()
  645. {
  646. $eth = $this->eth;
  647. $eth->feeHistory(1, 'latest', [ 1, 40, 50 ], function ($err, $feeHistory) {
  648. if ($err !== null) {
  649. return $this->fail($err->getMessage());
  650. }
  651. $this->assertTrue($feeHistory->oldestBlock !== null);
  652. $this->assertTrue($feeHistory->baseFeePerGas !== null);
  653. $this->assertTrue($feeHistory->gasUsedRatio !== null);
  654. $this->assertEquals(count($feeHistory->gasUsedRatio), 1);
  655. $this->assertTrue($feeHistory->reward !== null);
  656. $this->assertEquals(count($feeHistory->reward), 1);
  657. $this->assertEquals(count($feeHistory->reward[0]), 3);
  658. });
  659. }
  660. /**
  661. * testGetBlockByNumberAsync
  662. *
  663. * @return void
  664. */
  665. public function testGetBlockByNumberAsync()
  666. {
  667. $eth = $this->eth;
  668. $eth->provider = $this->asyncHttpProvider;
  669. // should return reactphp promise
  670. $promise = $eth->getBlockByNumber('latest', false, function ($err, $block) {
  671. if ($err !== null) {
  672. return $this->assertTrue($err !== null);
  673. }
  674. // weird behavior, see https://github.com/web3p/web3.php/issues/16
  675. $this->assertTrue($block !== null);
  676. });
  677. $this->assertTrue($promise instanceof \React\Promise\PromiseInterface);
  678. \React\Async\await($promise);
  679. }
  680. /**
  681. * testUnallowedMethod
  682. *
  683. * @return void
  684. */
  685. public function testUnallowedMethod()
  686. {
  687. $this->expectException(RuntimeException::class);
  688. $eth = $this->eth;
  689. $eth->hello(function ($err, $hello) {
  690. if ($err !== null) {
  691. return $this->fail($err->getMessage());
  692. }
  693. $this->assertTrue(true);
  694. });
  695. }
  696. /**
  697. * testWrongCallback
  698. *
  699. * @return void
  700. */
  701. public function testWrongCallback()
  702. {
  703. $this->expectException(InvalidArgumentException::class);
  704. $eth = $this->eth;
  705. $eth->protocolVersion();
  706. }
  707. }