eth_newBlockFilter
This commit is contained in:
parent
1d29fd0138
commit
4a2d64c398
@ -267,6 +267,13 @@ class Eth
|
|||||||
'validators' => FilterValidator::class
|
'validators' => FilterValidator::class
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
],
|
||||||
|
'eth_newBlockFilter' => [
|
||||||
|
'params' => [
|
||||||
|
[
|
||||||
|
'validators' => QuantityValidator::class
|
||||||
|
]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -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
|
* testUnallowedMethod
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user