diff --git a/src/Methods/Eth/GasPrice.php b/src/Methods/Eth/GasPrice.php index 8bef5d4..9218cc1 100644 --- a/src/Methods/Eth/GasPrice.php +++ b/src/Methods/Eth/GasPrice.php @@ -13,6 +13,7 @@ namespace Web3\Methods\Eth; use InvalidArgumentException; use Web3\Methods\EthMethod; +use Web3\Formatters\BigNumberFormatter; class GasPrice extends EthMethod { @@ -35,7 +36,9 @@ class GasPrice extends EthMethod * * @var array */ - protected $outputFormatters = []; + protected $outputFormatters = [ + BigNumberFormatter::class + ]; /** * defaultValues diff --git a/test/unit/EthApiTest.php b/test/unit/EthApiTest.php index 2ea2c5b..b7c3959 100644 --- a/test/unit/EthApiTest.php +++ b/test/unit/EthApiTest.php @@ -126,7 +126,7 @@ class EthApiTest extends TestCase if ($err !== null) { return $this->fail($err->getMessage()); } - $this->assertTrue(is_string($gasPrice)); + $this->assertTrue(is_numeric($gasPrice->toString())); }); }