def lazy_function(): sig = ContractFunction.check_sig(function_sign) return JsonRPC.send(JsonRPC.eth_call( dict(tx, data=sig + AbiEncoder.encodes(function_args, function_args_type)), tag), rpc_host=host)['result']
def lazy_function(transaction=None): if transaction is None: transaction = {} return JsonRPC.send(JsonRPC.eth_call( dict(transaction, data=function_sign + AbiEncoder.encodes(function_args, function_args_type)), tag), rpc_host=host)['result']
def call(trans): """ call the contract_methods :param trans: transaction with contract invocation's information :return: results of function """ if trans.chain_type == 'Ethereum': call_json = JsonRPC.eth_call(trans.jsonize()) # print(json.dumps(tx_response, sort_keys=True, indent=4, separators=(', ', ': '))) return JsonRPC.send(call_json, HTTP_HEADER, trans.chain_host)['result'] else: raise TypeError("unsupported chain-type: ", +trans.chain_type)