From 16d341455d07929815ce003725f14750d143b79e Mon Sep 17 00:00:00 2001 From: guanzi Date: Wed, 1 Aug 2018 19:32:44 +0800 Subject: [PATCH] add method: personal_lockAccount --- src/Methods/Personal/LockAccount.php | 69 ++++++++++++++++++++++++++++ src/Personal.php | 4 +- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 src/Methods/Personal/LockAccount.php diff --git a/src/Methods/Personal/LockAccount.php b/src/Methods/Personal/LockAccount.php new file mode 100644 index 0000000..0d8a44e --- /dev/null +++ b/src/Methods/Personal/LockAccount.php @@ -0,0 +1,69 @@ + + * + * @author Peter Lai + * @license MIT + */ + +namespace Web3\Methods\Personal; + +use InvalidArgumentException; +use Web3\Methods\EthMethod; +use Web3\Validators\AddressValidator; +use Web3\Validators\StringValidator; +use Web3\Validators\QuantityValidator; +use Web3\Formatters\AddressFormatter; +use Web3\Formatters\StringFormatter; +use Web3\Formatters\NumberFormatter; + +class LockAccount extends EthMethod +{ + /** + * validators + * + * @var array + */ + protected $validators = [ + AddressValidator::class + ]; + + /** + * inputFormatters + * + * @var array + */ + protected $inputFormatters = [ + AddressFormatter::class + ]; + + /** + * outputFormatters + * + * @var array + */ + protected $outputFormatters = []; + + /** + * defaultValues + * + * @var array + */ + protected $defaultValues = []; + + /** + * construct + * + * @param string $method + * @param array $arguments + * @return void + */ + // public function __construct($method='', $arguments=[]) + // { + // parent::__construct($method, $arguments); + // } +} + diff --git a/src/Personal.php b/src/Personal.php index 77c5e4c..75aa200 100644 --- a/src/Personal.php +++ b/src/Personal.php @@ -38,7 +38,7 @@ class Personal * @var array */ private $allowedMethods = [ - 'personal_listAccounts', 'personal_newAccount', 'personal_unlockAccount', 'personal_sendTransaction' + 'personal_listAccounts', 'personal_newAccount', 'personal_unlockAccount', 'personal_lockAccount', 'personal_sendTransaction' ]; /** @@ -177,4 +177,4 @@ class Personal $this->provider->batch($status); } -} \ No newline at end of file +}