mirror of https://github.com/nucypher/nucypher.git
Update dkg ritual acceptance test to use updated fixtures and contracts.
parent
681e3b1061
commit
acb89db902
|
@ -48,6 +48,7 @@ def test_ursula_ritualist(
|
||||||
initiator,
|
initiator,
|
||||||
bob,
|
bob,
|
||||||
ritual_token,
|
ritual_token,
|
||||||
|
accounts,
|
||||||
):
|
):
|
||||||
"""Tests the DKG and the encryption/decryption of a message"""
|
"""Tests the DKG and the encryption/decryption of a message"""
|
||||||
signer = Web3Signer(client=testerchain.client)
|
signer = Web3Signer(client=testerchain.client)
|
||||||
|
@ -62,10 +63,11 @@ def test_ursula_ritualist(
|
||||||
amount = coordinator_agent.get_ritual_initiation_cost(
|
amount = coordinator_agent.get_ritual_initiation_cost(
|
||||||
providers=cohort_staking_provider_addresses, duration=DURATION
|
providers=cohort_staking_provider_addresses, duration=DURATION
|
||||||
)
|
)
|
||||||
tx = ritual_token.functions.approve(
|
ritual_token.approve(
|
||||||
coordinator_agent.contract_address, amount
|
coordinator_agent.contract_address,
|
||||||
).transact({"from": initiator.transacting_power.account})
|
amount,
|
||||||
testerchain.wait_for_receipt(tx)
|
sender=accounts[initiator.transacting_power.account],
|
||||||
|
)
|
||||||
|
|
||||||
receipt = coordinator_agent.initiate_ritual(
|
receipt = coordinator_agent.initiate_ritual(
|
||||||
providers=cohort_staking_provider_addresses,
|
providers=cohort_staking_provider_addresses,
|
||||||
|
@ -163,10 +165,11 @@ def test_ursula_ritualist(
|
||||||
def test_decrypt(threshold_message_kit):
|
def test_decrypt(threshold_message_kit):
|
||||||
"""Decrypts a message and checks that it matches the original plaintext"""
|
"""Decrypts a message and checks that it matches the original plaintext"""
|
||||||
# authorize Enrico to encrypt for ritual
|
# authorize Enrico to encrypt for ritual
|
||||||
tx = global_allow_list.functions.authorize(
|
global_allow_list.authorize(
|
||||||
RITUAL_ID, [signer.accounts[0]]
|
RITUAL_ID,
|
||||||
).transact({"from": initiator.transacting_power.account})
|
[signer.accounts[0]],
|
||||||
testerchain.wait_for_receipt(tx)
|
sender=accounts[initiator.transacting_power.account],
|
||||||
|
)
|
||||||
|
|
||||||
print("==================== DKG DECRYPTION ====================")
|
print("==================== DKG DECRYPTION ====================")
|
||||||
# ritual_id, ciphertext, conditions are obtained from the side channel
|
# ritual_id, ciphertext, conditions are obtained from the side channel
|
||||||
|
|
Loading…
Reference in New Issue