eth_newBlockFilter

This commit is contained in:
sc0Vu 2017-12-14 22:01:09 +08:00
parent 1d29fd0138
commit 4a2d64c398
2 changed files with 33 additions and 0 deletions

View File

@ -267,6 +267,13 @@ class Eth
'validators' => FilterValidator::class
]
]
],
'eth_newBlockFilter' => [
'params' => [
[
'validators' => QuantityValidator::class
]
]
]
];

View File

@ -865,6 +865,32 @@ class EthTest extends TestCase
});
}
/**
* testNewBlockFilter
*
* @return void
*/
public function testNewBlockFilter()
{
$eth = $this->eth;
$eth->newBlockFilter('0x01', function ($err, $filter) {
if ($err !== null) {
// infura banned us to new filter
return $this->assertTrue($err->getCode() === 405);
}
if (isset($filter->result)) {
$this->assertTrue(is_string($filter->result));
} else {
if (isset($filter->error)) {
$this->assertTrue(is_string($filter->error->message));
} else {
$this->assertTrue(true);
}
}
});
}
/**
* testUnallowedMethod
*