eth_getUncleCountByBlockHash

This commit is contained in:
sc0Vu 2017-12-13 22:03:38 +08:00
parent 2f7a9f901b
commit 2772c30ed1
2 changed files with 32 additions and 0 deletions

View File

@ -89,6 +89,13 @@ class Eth
]
]
],
'eth_getUncleCountByBlockHash' => [
'params' => [
[
'validators' => BlockHashValidator::class
]
]
],
];
/**

View File

@ -312,6 +312,31 @@ class EthTest extends TestCase
});
}
/**
* testGetUncleCountByBlockHash
*
* @return void
*/
public function testGetUncleCountByBlockHash()
{
$eth = $this->web3->eth;
$eth->getUncleCountByBlockHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $uncleCount) {
if ($err !== null) {
return $this->fail($err->getMessage());
}
if (isset($uncleCount->result)) {
$this->assertTrue(is_string($uncleCount->result));
} else {
if (isset($uncleCount->error)) {
$this->fail($uncleCount->error->message);
} else {
$this->assertTrue(true);
}
}
});
}
/**
* testUnallowedMethod
*