From 5313b4c8a6b1043b6b8779ef05f069d0bd06596a Mon Sep 17 00:00:00 2001 From: nolash Date: Thu, 6 Aug 2020 09:53:26 +0200 Subject: [PATCH] Translate dict input --- scripts/web3_middleware.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/web3_middleware.py b/scripts/web3_middleware.py index 821ee9f..79d7009 100644 --- a/scripts/web3_middleware.py +++ b/scripts/web3_middleware.py @@ -43,6 +43,11 @@ class PlatformMiddleware: r.append(p) return r + if params.__class__.__name__ == 'list' and len(params) > 0: + return params[0] + + return params + def __call__(self, method, suspect_params): self.id_seq += 1 @@ -77,5 +82,5 @@ class PlatformMiddleware: w3 = Web3(WebsocketProvider('ws://127.0.0.1:8546')) w3.eth.personal = w3.geth.personal w3.middleware_onion.add(PlatformMiddleware) -print(w3.eth.personal.newAccount('foo')) -#print(w3.eth.blockNumber) +#print(w3.eth.personal.newAccount('foo')) +print(w3.eth.blockNumber)