chore: move network out of contact components
This commit is contained in:
@@ -11,11 +11,12 @@ from cic_types.ext.metadata import MetadataRequestsHandler
|
||||
from cic_types.ext.metadata.signer import Signer as MetadataSigner
|
||||
from chainlib.cli.config import Config
|
||||
from chainlib.chain import ChainSpec
|
||||
|
||||
# Local Modules
|
||||
from cic.contract.processor import ContractProcessor
|
||||
from cic.contract.components.attachment import Attachment
|
||||
from cic.contract.components.meta import Meta
|
||||
from cic.contract.components.network import Network
|
||||
from cic.contract.network import Network
|
||||
from cic.contract.components.proof import Proof
|
||||
from cic.contract.components.token import Token
|
||||
from cic.contract.helpers import init_writers_from_config
|
||||
@@ -87,7 +88,7 @@ def generate_contract(
|
||||
log.debug("Generating token")
|
||||
token = Token(directory, interactive=interactive)
|
||||
token.start()
|
||||
|
||||
|
||||
log.debug("Generating proof")
|
||||
proof = Proof(directory, interactive=interactive)
|
||||
proof.start()
|
||||
@@ -103,12 +104,14 @@ def generate_contract(
|
||||
network = Network(directory, targets=targets)
|
||||
network.start()
|
||||
|
||||
log.debug(f"""Populating infomation from network:
|
||||
log.debug(
|
||||
f"""Populating infomation from network:
|
||||
CIC_REGISTRY_ADDRESS: {config.get("CIC_REGISTRY_ADDRESS")}
|
||||
CHAIN_SPEC: {config.get("CHAIN_SPEC")}
|
||||
RPC_PROVIDER: {config.get("RPC_PROVIDER")}
|
||||
AUTH_KEY: {config.get("AUTH_KEY")}
|
||||
""")
|
||||
"""
|
||||
)
|
||||
for target in targets:
|
||||
m = importlib.import_module(f"cic.ext.{target}.start")
|
||||
m.extension_start(
|
||||
@@ -116,7 +119,9 @@ def generate_contract(
|
||||
registry_address=config.get("CIC_REGISTRY_ADDRESS"),
|
||||
chain_spec=ChainSpec.from_chain_str(config.get("CHAIN_SPEC")),
|
||||
rpc_provider=config.get("RPC_PROVIDER"),
|
||||
key_account_address=config.get("AUTH_KEY"), # TODO this should come from the wallet keystore
|
||||
key_account_address=config.get(
|
||||
"AUTH_KEY"
|
||||
), # TODO this should come from the wallet keystore
|
||||
)
|
||||
network.load()
|
||||
|
||||
@@ -180,7 +185,7 @@ def deploy_contract(
|
||||
config.add(chain_spec, "CHAIN_SPEC", exists_ok=True)
|
||||
log.debug(f"using CHAIN_SPEC: {str(chain_spec)} from network")
|
||||
print(chain_spec)
|
||||
|
||||
|
||||
signer_hint = config.get("WALLET_KEY_FILE")
|
||||
(rpc, signer) = cmd_mod.parse_adapter(config, signer_hint)
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# standard imports
|
||||
import os
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
# external imports
|
||||
from chainlib.chain import ChainSpec
|
||||
|
||||
# local imports
|
||||
from cic.contract.base import Data, data_dir
|
||||
|
||||
Reference in New Issue
Block a user