diff --git a/src/Methods/Web3/ClientVersion.php b/src/Methods/Web3/ClientVersion.php index 5337223..90f12fe 100644 --- a/src/Methods/Web3/ClientVersion.php +++ b/src/Methods/Web3/ClientVersion.php @@ -12,10 +12,9 @@ namespace Web3\Methods\Web3; use InvalidArgumentException; -use Web3\Methods\IMethod; -use Web3\Methods\JSONRPC; +use Web3\Methods\EthMethod; -class ClientVersion extends JSONRPC implements IMethod +class ClientVersion extends EthMethod { /** * inputFormatters @@ -31,6 +30,13 @@ class ClientVersion extends JSONRPC implements IMethod */ protected $outputFormatters = []; + /** + * defaultValues + * + * @var array + */ + protected $defaultValues = []; + /** * construct * @@ -42,47 +48,4 @@ class ClientVersion extends JSONRPC implements IMethod // { // parent::__construct($method, $arguments); // } - - /** - * getInputFormatters - * - * @return array - */ - public function getInputFormatters() - { - return $this->inputFormatters; - } - - /** - * getOutputFormatters - * - * @return array - */ - public function getOutputFormatters() - { - return $this->outputFormatters; - } - - /** - * transform - * - * @param array $params - * @param array $rules - * @return array - */ - public function transform($params, $rules) - { - if (!is_array($params)) { - throw new InvalidArgumentException('Please use array params when call transform.'); - } - if (!is_array($rules)) { - throw new InvalidArgumentException('Please use array rules when call transform.'); - } - foreach ($params as $key => $param) { - if (isset($rules[$key])) { - $params[$key] = call_user_func([$rules[$key], 'format'], $param); - } - } - return $params; - } } \ No newline at end of file diff --git a/src/Methods/Web3/Sha3.php b/src/Methods/Web3/Sha3.php index a1d2fa0..c899f89 100644 --- a/src/Methods/Web3/Sha3.php +++ b/src/Methods/Web3/Sha3.php @@ -12,11 +12,10 @@ namespace Web3\Methods\Web3; use InvalidArgumentException; -use Web3\Methods\IMethod; -use Web3\Methods\JSONRPC; +use Web3\Methods\EthMethod; use Web3\Formatters\HexFormatter; -class Sha3 extends JSONRPC implements IMethod +class Sha3 extends EthMethod { /** * inputFormatters @@ -34,6 +33,13 @@ class Sha3 extends JSONRPC implements IMethod */ protected $outputFormatters = []; + /** + * defaultValues + * + * @var array + */ + protected $defaultValues = []; + /** * construct * @@ -45,47 +51,4 @@ class Sha3 extends JSONRPC implements IMethod // { // parent::__construct($method, $arguments); // } - - /** - * getInputFormatters - * - * @return array - */ - public function getInputFormatters() - { - return $this->inputFormatters; - } - - /** - * getOutputFormatters - * - * @return array - */ - public function getOutputFormatters() - { - return $this->outputFormatters; - } - - /** - * transform - * - * @param array $params - * @param array $rules - * @return array - */ - public function transform($params, $rules) - { - if (!is_array($params)) { - throw new InvalidArgumentException('Please use array params when call transform.'); - } - if (!is_array($rules)) { - throw new InvalidArgumentException('Please use array rules when call transform.'); - } - foreach ($params as $key => $param) { - if (isset($rules[$key])) { - $params[$key] = call_user_func([$rules[$key], 'format'], $param); - } - } - return $params; - } } \ No newline at end of file