1 Star 0 Fork 3

kentzhang/python-agent

forked from kentzhang/python-sdk 
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
codegen_template.py 720 Bytes
Copy Edit Raw Blame History
cyjseagull authored 2019-08-08 18:28 +08:00 . fix sider
# template for codegen
from client.bcosclient import (
BcosClient
)
from client.datatype_parser import DatatypeParser
import json
class TEMPLATE_CLASSNAME: # name of abi
address = None
contract_abi_string = '''TEMPLATE_CONTRACT_ABI'''
contract_abi = None
data_parser = DatatypeParser()
client = None
def __init__(self, address):
self.client = BcosClient()
self.address = address
self.contract_abi = json.loads(self.contract_abi_string)
self.data_parser.set_abi(self.contract_abi)
def deploy(self, contract_bin_file):
result = self.client.deployFromFile(contract_bin_file)
self.address = result["contractAddress"]
return result
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/coderkent/python-agent.git
git@gitee.com:coderkent/python-agent.git
coderkent
python-agent
python-agent
master

Search