diff --git a/src/Eth.php b/src/Eth.php index 386a36a..a76ed73 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -59,6 +59,18 @@ class Eth ], ] ], + 'eth_getTransactionCount' => [ + 'params'=> [ + [ + 'validators' => AddressValidator::class, + ], [ + 'default' => 'latest', + 'validators' => [ + TagValidator::class, QuantityValidator::class, + ] + ], + ] + ], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index da45d8a..6d0c568 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -241,6 +241,27 @@ class EthTest extends TestCase }); } + /** + * testTransactionCount + * + * @return void + */ + public function testTransactionCount() + { + $eth = $this->web3->eth; + + $eth->getTransactionCount('0x407d73d8a49eeb85d32cf465507dd71d507100c1', function ($err, $transactionCount) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($transactionCount->result)) { + $this->assertTrue(is_string($transactionCount->result)); + } else { + $this->fail($transactionCount->error->message); + } + }); + } + /** * testUnallowedMethod *