Uncomment dict translate

This commit is contained in:
nolash 2020-08-06 09:58:47 +02:00
parent c2d4f105fe
commit 1dd1c87165
Signed by: lash
GPG Key ID: 93EC1C676274C889

View File

@ -34,7 +34,9 @@ class PlatformMiddleware:
self.make_request = make_request self.make_request = make_request
# TODO: understand what format input params come in
# single entry input gives a tuple on params, wtf... # single entry input gives a tuple on params, wtf...
# dict input comes as [{}] and fails if not passed on as an array
@staticmethod @staticmethod
def _translate_params(params): def _translate_params(params):
if params.__class__.__name__ == 'tuple': if params.__class__.__name__ == 'tuple':
@ -43,8 +45,8 @@ class PlatformMiddleware:
r.append(p) r.append(p)
return r return r
if params.__class__.__name__ == 'list' and len(params) > 0: # if params.__class__.__name__ == 'list' and len(params) > 0:
return params[0] # return params[0]
return params return params
@ -86,6 +88,6 @@ w3.middleware_onion.add(PlatformMiddleware)
#print(w3.eth.blockNumber) #print(w3.eth.blockNumber)
print(w3.eth.sendTransaction({ print(w3.eth.sendTransaction({
'to': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601', 'to': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
'from': web3.eth.coinbase, 'from': '0xc305c901078781C232A2a521C2aF7980f8385ee9',
'value': 1000 'value': 1000
}) }))