Net apis.

This commit is contained in:
sc0Vu 2018-01-12 11:05:25 +08:00
parent e6adbdd303
commit 819608d510
4 changed files with 26 additions and 4 deletions

View File

@ -16,6 +16,13 @@ use Web3\Methods\EthMethod;
class Listening extends EthMethod class Listening extends EthMethod
{ {
/**
* validators
*
* @var array
*/
protected $validators = [];
/** /**
* inputFormatters * inputFormatters
* *

View File

@ -17,6 +17,13 @@ use Web3\Formatters\BigNumberFormatter;
class PeerCount extends EthMethod class PeerCount extends EthMethod
{ {
/**
* validators
*
* @var array
*/
protected $validators = [];
/** /**
* inputFormatters * inputFormatters
* *

View File

@ -16,6 +16,13 @@ use Web3\Methods\EthMethod;
class Version extends EthMethod class Version extends EthMethod
{ {
/**
* validators
*
* @var array
*/
protected $validators = [];
/** /**
* inputFormatters * inputFormatters
* *

View File

@ -99,10 +99,11 @@ class Net
} else { } else {
$methodObject = $this->methods[$method]; $methodObject = $this->methods[$method];
} }
$inputs = $methodObject->transform($arguments, $methodObject->inputFormatters); if ($methodObject->validate($arguments)) {
$methodObject->arguments = $inputs; $inputs = $methodObject->transform($arguments, $methodObject->inputFormatters);
$methodObject->arguments = $inputs;
$this->provider->send($methodObject, $callback); $this->provider->send($methodObject, $callback);
}
} }
} }