Remove test code, lint fixes
This commit is contained in:
parent
adb012f51f
commit
ad64ad8720
@ -22,7 +22,6 @@ from stack_orchestrator.opts import opts
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from shutil import copyfile, copytree
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import tomli
|
||||
@ -62,26 +61,12 @@ def _get_node_moniker_from_config(network_dir: Path):
|
||||
return moniker
|
||||
|
||||
|
||||
def _get_node_key_from_gentx(gentx_file_name: str):
|
||||
gentx_file_path = Path(gentx_file_name)
|
||||
if gentx_file_path.exists():
|
||||
with open(Path(gentx_file_name), "rb") as f:
|
||||
parsed_json = json.load(f)
|
||||
print(f"parsed_json: {parsed_json}")
|
||||
return parsed_json['body']['messages'][0]['validator_address']
|
||||
else:
|
||||
print(f"Error: gentx file: {gentx_file_name} does not exist")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def _comma_delimited_to_list(list_str: str):
|
||||
return list_str.split(",") if list_str else []
|
||||
|
||||
|
||||
def _get_node_keys_from_gentx_files(gentx_address_list: str):
|
||||
node_keys = []
|
||||
gentx_addresses = _comma_delimited_to_list(gentx_address_list)
|
||||
print(f"gentx_files: {gentx_addresses}")
|
||||
return gentx_addresses
|
||||
|
||||
|
||||
@ -263,10 +248,10 @@ def setup(command_context: DeployCommandContext, parameters: LaconicStackSetupCo
|
||||
# First look in the supplied gentx files for the other nodes' keys
|
||||
other_node_keys = _get_node_keys_from_gentx_files(parameters.gentx_address_list)
|
||||
# Add those keys to our genesis, with balances we determine here (why?)
|
||||
print(f"other_node_keys: {other_node_keys}")
|
||||
for other_node_key in other_node_keys:
|
||||
outputk, statusk = run_container_command(
|
||||
command_context, "laconicd", f"laconicd genesis add-genesis-account {other_node_key} 12900000000000000000000{currency}\
|
||||
command_context, "laconicd", f"laconicd genesis add-genesis-account {other_node_key} \
|
||||
12900000000000000000000{currency}\
|
||||
--home {laconicd_home_path_in_container} --keyring-backend test", mounts)
|
||||
if options.debug:
|
||||
print(f"Command output: {outputk}")
|
||||
|
@ -13,7 +13,6 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
||||
|
||||
import os
|
||||
from typing import List, Any
|
||||
from stack_orchestrator.deploy.deploy_types import DeployCommandContext, VolumeMapping
|
||||
from stack_orchestrator.util import get_parsed_stack_config, get_yaml, get_pod_list, resolve_compose_file
|
||||
|
@ -543,8 +543,8 @@ def create_operation(deployment_command_context, spec_file, deployment_dir, netw
|
||||
@click.option("--network-dir", help="Directory for network files")
|
||||
@click.argument('extra_args', nargs=-1)
|
||||
@click.pass_context
|
||||
def setup(ctx, node_moniker, chain_id, key_name, gentx_files, gentx_addresses, genesis_file, initialize_network, join_network, create_network,
|
||||
network_dir, extra_args):
|
||||
def setup(ctx, node_moniker, chain_id, key_name, gentx_files, gentx_addresses, genesis_file, initialize_network, join_network,
|
||||
create_network, network_dir, extra_args):
|
||||
parmeters = LaconicStackSetupCommand(chain_id, node_moniker, key_name, initialize_network, join_network, create_network,
|
||||
gentx_files, gentx_addresses, genesis_file, network_dir)
|
||||
call_stack_deploy_setup(ctx.obj, parmeters, extra_args)
|
||||
|
Loading…
Reference in New Issue
Block a user