From 6095c9290026147a549b202176742e4c563a5ac3 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Thu, 14 Dec 2017 19:24:01 +0800 Subject: [PATCH] eth_compileLLL --- src/Eth.php | 7 +++++++ test/unit/EthTest.php | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/Eth.php b/src/Eth.php index 357a918..2e05955 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -245,6 +245,13 @@ class Eth 'validators' => StringValidator::class ] ] + ], + 'eth_compileLLL' => [ + 'params' => [ + [ + 'validators' => StringValidator::class + ] + ] ] ]; diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 73caab4..cab711e 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -784,6 +784,31 @@ class EthTest extends TestCase }); } + /** + * testCompileLLL + * + * @return void + */ + public function testCompileLLL() + { + $eth = $this->eth; + + $eth->compileLLL('(returnlll (suicide (caller)))', 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 *