t3ran13 / php-graphene-node-client

PHP client for connection to Graphene node (STEEM/GOLOS/VIZ/WHALESHARES)
MIT License
12 stars 12 forks source link

First connector is always taken #23

Closed dignityinside closed 5 years ago

dignityinside commented 5 years ago

php-graphene-node-client v.5.2.1, PHP 7.2.19, Ubuntu 18.04 LTS.

I don’t understand why the first connector is always taken.

A simple example:


 <?php

require_once '../vendor/autoload.php';

$golosConntector = new \GrapheneNodeClient\Connectors\WebSocket\GolosWSConnector();

$command = new \GrapheneNodeClient\Commands\Commands($golosConntector);

$command->get_dynamic_global_properties();
$commandQuery = new \GrapheneNodeClient\Commands\CommandQueryData();
$result = $command->execute($commandQuery);
$result = $result['result']['current_supply'];

var_dump($result);

$vizConntector = new \GrapheneNodeClient\Connectors\WebSocket\VizWSConnector();

$command = new \GrapheneNodeClient\Commands\Commands($vizConntector);

$command->get_dynamic_global_properties();
$commandQuery = new \GrapheneNodeClient\Commands\CommandQueryData();
$result = $command->execute($commandQuery);
$result = $result['result']['current_supply'];

var_dump($result);```

Result:

```php
string(19) "175833624.740 GOLOS"
string(19) "175833624.740 GOLOS"```

I expect get first time golos, the second time viz. but became alway golos.
t3ran13 commented 5 years ago

fixed