eth_getUncleByBlockNumberAndIndex

This commit is contained in:
sc0Vu 2017-12-14 19:10:10 +08:00
parent 00afa82f0b
commit 24deddeade
2 changed files with 36 additions and 0 deletions

View File

@ -226,6 +226,17 @@ class Eth
]
]
],
'eth_getUncleByBlockNumberAndIndex' => [
'params' => [
[
'validators' => [
QuantityValidator::class, TagValidator::class
]
], [
'validators' => QuantityValidator::class
]
]
],
];
/**

View File

@ -708,6 +708,31 @@ class EthTest extends TestCase
});
}
/**
* testGetUncleByBlockNumberAndIndex
*
* @return void
*/
public function testGetUncleByBlockNumberAndIndex()
{
$eth = $this->eth;
$eth->getUncleByBlockNumberAndIndex('0xe8', '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
*