From 6c4e422bfda4464d2704d01fa084a26f79165817 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Tue, 9 Jan 2018 18:21:18 +0800 Subject: [PATCH] Catch methods. --- src/Net.php | 3 +++ src/Web3.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Net.php b/src/Net.php index 4ddf6a4..cdc9290 100644 --- a/src/Net.php +++ b/src/Net.php @@ -95,6 +95,9 @@ class Net // new the method $methodClass = sprintf("\Web3\Methods\%s\%s", ucfirst($class[1]), ucfirst($name)); $methodObject = new $methodClass($method, $arguments); + $this->methods[$method] = $methodObject; + } else { + $methodObject = $this->methods[$method]; } $inputs = $methodObject->transform($arguments, $methodObject->inputFormatters); $methodObject->arguments = $inputs; diff --git a/src/Web3.php b/src/Web3.php index 48464ee..d2b46fb 100644 --- a/src/Web3.php +++ b/src/Web3.php @@ -128,6 +128,9 @@ class Web3 // new the method $methodClass = sprintf("\Web3\Methods\%s\%s", ucfirst($class[1]), ucfirst($name)); $methodObject = new $methodClass($method, $arguments); + $this->methods[$method] = $methodObject; + } else { + $methodObject = $this->methods[$method]; } $inputs = $methodObject->transform($arguments, $methodObject->inputFormatters); $methodObject->arguments = $inputs;