eth batch

This commit is contained in:
sc0Vu 2017-12-18 11:57:03 +08:00
parent 1cc89bc04c
commit d1c5ae15d0
2 changed files with 35 additions and 0 deletions

View File

@ -483,4 +483,17 @@ class Eth
} }
return false; return false;
} }
/**
* batch
*
* @param bool $status
* @return void
*/
public function batch($status)
{
$status = is_bool($status);
$this->provider->batch($status);
}
} }

View File

@ -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 * testUnallowedMethod
* *