-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/ws-provider
- Loading branch information
Showing
72 changed files
with
236 additions
and
744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
ganache-cli -g 0 -l 6000000 > /dev/null & | ||
ganachecli_pid=$! | ||
echo "Start ganache-cli pid: $ganachecli_pid and sleep 3 seconds" | ||
ganache -g 0 -l 6000000 --wallet.seed test,test,test,test,test,test,test,test,test,test,test,test --miner.coinbase 0x4DABDacE120050c79E355A5Ba99047B955f37fFc > /dev/null & | ||
ganache_pid=$! | ||
echo "Start ganache pid: $ganache_pid and sleep 3 seconds" | ||
|
||
sleep 3 | ||
|
||
vendor/bin/phpunit --coverage-clover=coverage.xml | ||
ret=$? | ||
|
||
kill -9 $ganachecli_pid | ||
kill -9 $ganache_pid | ||
echo "Kill ganache-cli" | ||
|
||
exit $ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of web3.php package. | ||
* | ||
* (c) Kuan-Cheng,Lai <[email protected]> | ||
* | ||
* @author Peter Lai <[email protected]> | ||
* @license MIT | ||
*/ | ||
|
||
namespace Web3\Formatters; | ||
|
||
use InvalidArgumentException; | ||
use Web3\Utils; | ||
use Web3\Formatters\IFormatter; | ||
use Web3\Formatters\BigNumberFormatter; | ||
|
||
class FeeHistoryFormatter implements IFormatter | ||
{ | ||
/** | ||
* format | ||
* | ||
* @param mixed $value | ||
* @return string | ||
*/ | ||
public static function format($value) | ||
{ | ||
if (isset($value->oldestBlock)) { | ||
$value->oldestBlock = BigNumberFormatter::format($value->oldestBlock); | ||
} | ||
if (isset($value->baseFeePerGas)) { | ||
foreach ($value->baseFeePerGas as $key => $baseFeePerGas) { | ||
$value->baseFeePerGas[$key] = BigNumberFormatter::format($baseFeePerGas); | ||
} | ||
} | ||
if (isset($value->reward)) { | ||
foreach ($value->reward as $keyOut => $rewards) { | ||
foreach ($rewards as $keyIn => $reward) { | ||
$value->reward[$keyOut][$keyIn] = BigNumberFormatter::format($reward); | ||
} | ||
} | ||
} | ||
return $value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of web3.php package. | ||
* | ||
* (c) Kuan-Cheng,Lai <[email protected]> | ||
* | ||
* @author Peter Lai <[email protected]> | ||
* @license MIT | ||
*/ | ||
|
||
namespace Web3\Methods\Eth; | ||
|
||
use InvalidArgumentException; | ||
use Web3\Methods\EthMethod; | ||
use Web3\Validators\TagValidator; | ||
use Web3\Validators\QuantityValidator; | ||
use Web3\Validators\ArrayNumberValidator; | ||
use Web3\Formatters\QuantityFormatter; | ||
use Web3\Formatters\OptionalQuantityFormatter; | ||
use Web3\Formatters\FeeHistoryFormatter; | ||
|
||
class FeeHistory extends EthMethod | ||
{ | ||
/** | ||
* validators | ||
* | ||
* @var array | ||
*/ | ||
protected $validators = [ | ||
QuantityValidator::class, [ | ||
TagValidator::class, QuantityValidator::class | ||
], ArrayNumberValidator::class | ||
]; | ||
|
||
/** | ||
* inputFormatters | ||
* | ||
* @var array | ||
*/ | ||
protected $inputFormatters = [ | ||
QuantityFormatter::class, OptionalQuantityFormatter::class | ||
]; | ||
|
||
/** | ||
* outputFormatters | ||
* | ||
* @var array | ||
*/ | ||
protected $outputFormatters = [ | ||
FeeHistoryFormatter::class | ||
]; | ||
|
||
/** | ||
* defaultValues | ||
* | ||
* @var array | ||
*/ | ||
protected $defaultValues = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.