示例#1
0
function sendRpcCommand(Client $client, $command, $arguments = [])
{
    try {
        return json_decode($client->sendCommand(new Command($command, $arguments))->getBody()->getContents());
    } catch (Exception $e) {
        return false;
    }
}
示例#2
0
 public function testSendCommand()
 {
     $response = \Mockery::mock('\\Psr\\Http\\Message\\ResponseInterface');
     $driver = \Mockery::mock('\\Nbobtc\\Http\\Driver\\DriverInterface');
     $driver->shouldReceive('execute')->andReturn($response);
     $client = new Client('https://*****:*****@localhost:18332');
     $client->withDriver($driver);
     $command = new Command('gettransaction', array('transactionId'));
     $response = $client->sendCommand($command);
 }