shh_newGroup

This commit is contained in:
sc0Vu 2018-01-26 17:25:04 +08:00
parent 647da46e09
commit f6a7ffebdb
3 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,58 @@
<?php
/**
* This file is part of web3.php package.
*
* (c) Kuan-Cheng,Lai <alk03073135@gmail.com>
*
* @author Peter Lai <alk03073135@gmail.com>
* @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);
// }
}

View File

@ -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'
];
/**

View File

@ -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