From d5a2d4c0418b0462abe270722007939ddee00ba9 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Thu, 14 Dec 2017 19:04:47 +0800 Subject: [PATCH] eth_getTransactionReceipt --- src/Eth.php | 7 +++++++ test/unit/EthTest.php | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/Eth.php b/src/Eth.php index 9401f33..1d7bec9 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -210,6 +210,13 @@ class Eth ] ] ], + 'eth_getTransactionReceipt' => [ + 'params' => [ + [ + 'validators' => BlockHashValidator::class + ] + ] + ], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 096e51c..79fde02 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -658,6 +658,31 @@ class EthTest extends TestCase }); } + /** + * testGetTransactionReceipt + * + * @return void + */ + public function testGetTransactionReceipt() + { + $eth = $this->eth; + + $eth->getTransactionReceipt('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $transaction) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($transaction->result)) { + $this->assertTrue(is_string($transaction->result)); + } else { + if (isset($transaction->error)) { + $this->fail($transaction->error->message); + } else { + $this->assertTrue(true); + } + } + }); + } + /** * testUnallowedMethod *