diff --git a/src/Eth.php b/src/Eth.php index 23bbb7a..9564032 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -483,4 +483,17 @@ class Eth } return false; } + + /** + * batch + * + * @param bool $status + * @return void + */ + public function batch($status) + { + $status = is_bool($status); + + $this->provider->batch($status); + } } \ No newline at end of file diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 984535e..5963784 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -1108,6 +1108,28 @@ class EthTest extends TestCase }); } + /** + * testBatch + * + * @return void + */ + public function testBatch() + { + $eth = $this->eth; + + $eth->batch(true); + $eth->protocolVersion(); + $eth->syncing(); + + $eth->provider->execute(function ($err, $data) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + $this->assertTrue(is_string($data[0]->result)); + $this->assertTrue($data[1]->result !== null); + }); + } + /** * testUnallowedMethod *