diff --git a/src/Eth.php b/src/Eth.php index 8074bd2..9e70c84 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -190,6 +190,15 @@ class Eth ] ] ], + 'eth_getTransactionByBlockHashAndIndex' => [ + 'params' => [ + [ + 'validators' => BlockHashValidator::class + ], [ + 'validators' => QuantityValidator::class + ] + ] + ], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 6a92fe9..8876652 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -608,6 +608,31 @@ class EthTest extends TestCase }); } + /** + * testGetTransactionByBlockHashAndIndex + * + * @return void + */ + public function testGetTransactionByBlockHashAndIndex() + { + $eth = $this->eth; + + $eth->getTransactionByBlockHashAndIndex('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', '0x0', 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 *