eth_getBlockTransactionCountByHash
This commit is contained in:
parent
9e868e4b5f
commit
d14b6c7ee1
@ -9,6 +9,7 @@ use Web3\RequestManagers\HttpRequestManager;
|
||||
use Web3\Validators\AddressValidator;
|
||||
use Web3\Validators\TagValidator;
|
||||
use Web3\Validators\QuantityValidator;
|
||||
use Web3\Validators\BlockHashValidator;
|
||||
|
||||
class Eth
|
||||
{
|
||||
@ -71,6 +72,13 @@ class Eth
|
||||
],
|
||||
]
|
||||
],
|
||||
'eth_getBlockTransactionCountByHash' => [
|
||||
'params' => [
|
||||
[
|
||||
'validators' => BlockHashValidator::class
|
||||
]
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -242,11 +242,11 @@ class EthTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* testTransactionCount
|
||||
* testGetTransactionCount
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testTransactionCount()
|
||||
public function testGetTransactionCount()
|
||||
{
|
||||
$eth = $this->web3->eth;
|
||||
|
||||
@ -262,6 +262,31 @@ class EthTest extends TestCase
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testGetBlockTransactionCountByHash
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGetBlockTransactionCountByHash()
|
||||
{
|
||||
$eth = $this->web3->eth;
|
||||
|
||||
$eth->getBlockTransactionCountByHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $transactionCount) {
|
||||
if ($err !== null) {
|
||||
return $this->fail($err->getMessage());
|
||||
}
|
||||
if (isset($transactionCount->result)) {
|
||||
$this->assertTrue(is_string($transactionCount->result));
|
||||
} else {
|
||||
if (isset($transactionCount->error)) {
|
||||
$this->fail($transactionCount->error->message);
|
||||
} else {
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testUnallowedMethod
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user