From f6a7ffebdba99f169e862915a1be0470d2cad12b Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Fri, 26 Jan 2018 17:25:04 +0800 Subject: [PATCH] shh_newGroup --- src/Methods/Shh/NewGroup.php | 58 ++++++++++++++++++++++++++++++++++++ src/Shh.php | 3 +- test/unit/ShhApiTest.php | 17 +++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/Methods/Shh/NewGroup.php diff --git a/src/Methods/Shh/NewGroup.php b/src/Methods/Shh/NewGroup.php new file mode 100644 index 0000000..e13b061 --- /dev/null +++ b/src/Methods/Shh/NewGroup.php @@ -0,0 +1,58 @@ + + * + * @author Peter Lai + * @license MIT + */ + +namespace Web3\Methods\Shh; + +use InvalidArgumentException; +use Web3\Methods\EthMethod; + +class NewGroup extends EthMethod +{ + /** + * validators + * + * @var array + */ + protected $validators = []; + + /** + * inputFormatters + * + * @var array + */ + protected $inputFormatters = []; + + /** + * 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); + // } +} \ No newline at end of file diff --git a/src/Shh.php b/src/Shh.php index e1ccee2..d700457 100644 --- a/src/Shh.php +++ b/src/Shh.php @@ -38,7 +38,8 @@ class Shh * @var array */ private $allowedMethods = [ - 'shh_version', 'shh_newIdentity', 'shh_hasIdentity' + 'shh_version', 'shh_newIdentity', 'shh_hasIdentity', + // doesn't exist: 'shh_newGroup' ]; /** diff --git a/test/unit/ShhApiTest.php b/test/unit/ShhApiTest.php index 9521b63..e216379 100644 --- a/test/unit/ShhApiTest.php +++ b/test/unit/ShhApiTest.php @@ -94,6 +94,23 @@ class ShhApiTest extends TestCase }); } + /** + * testNewGroup + * + * @return void + */ + // public function testNewGroup() + // { + // $shh = $this->shh; + + // $shh->newGroup(function ($err, $group) { + // if ($err !== null) { + // return $this->fail($err->getMessage()); + // } + // $this->assertEquals(mb_strlen($group), 132); + // }); + // } + /** * testWrongParam * We transform data and throw invalid argument exception