Exemple #1
0
def scrt_accounts(configuration: Config) -> List[SecretAccount]:
    """multisig accounts for signers"""
    threshold = configuration.signatures_threshold
    multisig_acc_addr = get_key_multisig_addr(f"ms{threshold}")

    res = []
    for i in range(1, threshold + 1):
        res.append(SecretAccount(multisig_acc_addr, f"t{i}"))
    return res
Exemple #2
0
def configuration():
    # get address of account 'a' on docker
    config = get_config(config_file='config/test_config.json')
    a_address = run("docker exec secretdev secretcli keys show a | jq '.address'", shell=True, stdout=PIPE)
    config.a_address = a_address.stdout.decode().strip()[1:-1].encode()
    config.multisig_acc_addr = get_key_multisig_addr(f"ms{config.signatures_threshold}")
    # config.enclave_key = path.join(tests_folder, config["path_to_certs"], 'io-master-cert.der')

    return config
Exemple #3
0
def configuration():
    # get address of account 'a' on docker
    config = Config(config_file='config/test_config.json')
    a_address = run("docker exec secretdev secretcli keys show a | jq '.address'", shell=True, stdout=PIPE)
    config['a_address'] = a_address.stdout.decode().strip()[1:-1].encode()
    config['multisig_acc_addr'] = get_key_multisig_addr(f"ms{config['signatures_threshold']}")
    config['enclave_key'] = path.join(tests_folder, config["path_to_certs"], 'io-master-cert.der')

    res = run("secretcli query compute list-contract-by-code 1 | jq '.[-1].address'", shell=True, stdout=PIPE)
    config['secret_contract_address'] = res.stdout.decode().strip()[1:-1]

    return config
Exemple #4
0
def multisig_account(configuration: Config):
    threshold = configuration.signatures_threshold
    multisig_addr = get_key_multisig_addr(f"ms{threshold}")
    return SecretAccount(multisig_addr, f"ms{configuration.signatures_threshold}")