eth batch
This commit is contained in:
parent
1cc89bc04c
commit
d1c5ae15d0
13
src/Eth.php
13
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);
|
||||
}
|
||||
}
|
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user