28 public function __construct($val =
'latest', array $params = [])
30 parent::__construct($val, $params);
48 if ($this->
isTag($val)) {
51 $return = parent::validate($val, $params);
54 if (is_null($return)) {
55 throw new \InvalidArgumentException(
'No valid block param: ' . $val);
73 return $this->value->toString();
85 protected function isTag($val =
false)
91 return (!is_int($val) && in_array($val, self::TAGS));
103 if ($this->
isTag()) {
106 $val = intval($this->value->toString());
107 $val = ($val === 0) ? $val : $this->value->toHex(
false);
120 return parent::validate($val, $params);
static ensureHexPrefix($str)
validateAddress($val, array $params)
validate($val, array $params)
__construct($val='latest', array $params=[])