eth_getUncleByBlockHashAndIndex

This commit is contained in:
sc0Vu 2017-12-14 19:08:15 +08:00
parent d5a2d4c041
commit 00afa82f0b
2 changed files with 34 additions and 0 deletions

View File

@ -217,6 +217,15 @@ class Eth
]
]
],
'eth_getUncleByBlockHashAndIndex' => [
'params' => [
[
'validators' => BlockHashValidator::class
], [
'validators' => QuantityValidator::class
]
]
],
];
/**

View File

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