def generate_args_for_slashing(testerchain,
                               ursula,
                               account,
                               corrupt_cfrag: bool = True):
    evidence = mock_ursula_reencrypts(ursula, corrupt_cfrag=corrupt_cfrag)

    # Sign Umbral public key using eth-key
    miner_umbral_public_key_hash = sha256_hash(
        get_coordinates_as_bytes(ursula.stamp))
    provider = testerchain.interface.provider
    address = to_canonical_address(account)
    sig_key = provider.ethereum_tester.backend._key_lookup[address]
    signed_miner_umbral_public_key = bytes(
        sig_key.sign_msg_hash(miner_umbral_public_key_hash))

    args = list(evidence.evaluation_arguments())
    args[-2] = signed_miner_umbral_public_key  # FIXME  #962
    return args
예제 #2
0
def generate_args_for_slashing(ursula, corrupt_cfrag: bool = True):
    evidence = mock_ursula_reencrypts(ursula, corrupt_cfrag=corrupt_cfrag)
    args = list(evidence.evaluation_arguments())
    return args