chainlib/chainlib/eth/rpc.py
2021-02-11 08:45:26 +01:00

18 lines
302 B
Python

# standard imports
import uuid
def jsonrpc_template():
return {
'jsonrpc': '2.0',
'id': str(uuid.uuid4()),
'method': None,
'params': [],
}
def jsonrpc_result(o, ep):
if o.get('error') != None:
raise ep.translate(o)
return o['result']