diff --git a/src/Methods/Eth/GetBlockByNumber.php b/src/Methods/Eth/GetBlockByNumber.php index fecb5aa..5a19167 100644 --- a/src/Methods/Eth/GetBlockByNumber.php +++ b/src/Methods/Eth/GetBlockByNumber.php @@ -14,6 +14,7 @@ namespace Web3\Methods\Eth; use InvalidArgumentException; use Web3\Methods\EthMethod; use Web3\Validators\QuantityValidator; +use Web3\Validators\TagValidator; use Web3\Validators\BooleanValidator; use Web3\Formatters\OptionalQuantityFormatter; use Web3\Formatters\BooleanFormatter; @@ -26,7 +27,9 @@ class GetBlockByNumber extends EthMethod * @var array */ protected $validators = [ - QuantityValidator::class, BooleanValidator::class + [ + QuantityValidator::class, TagValidator::class + ], BooleanValidator::class ]; /** @@ -50,7 +53,9 @@ class GetBlockByNumber extends EthMethod * * @var array */ - protected $defaultValues = []; + protected $defaultValues = [ + 0 => 'latest' + ]; /** * construct