diff --git a/src/Eth.php b/src/Eth.php index 2e05955..05abcef 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -252,6 +252,13 @@ class Eth 'validators' => StringValidator::class ] ] + ], + 'eth_compileSerpent' => [ + 'params' => [ + [ + 'validators' => StringValidator::class + ] + ] ] ]; diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index cab711e..f6396a3 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -809,6 +809,31 @@ class EthTest extends TestCase }); } + /** + * testCompileSerpent + * + * @return void + */ + public function testCompileSerpent() + { + $eth = $this->eth; + + $eth->compileSerpent('\/* some serpent *\/', function ($err, $compiled) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($compiled->result)) { + $this->assertTrue(is_string($compiled->result)); + } else { + // if (isset($compilers->error)) { + $this->assertTrue(true); + // } else { + // $this->assertTrue(true); + // } + } + }); + } + /** * testUnallowedMethod *