Skip to content

Commit

Permalink
update ferveo pk length
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Jul 3, 2023
1 parent 48d5794 commit 3021892
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions contracts/contracts/coordination/Coordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ contract Coordinator is AccessControlDefaultAdminRules {
}

function setProviderPublicKey(bytes calldata publicKey) external {
// TODO: Verify public key length
require(publicKey.length == 48, "Invalid public key length");
require(publicKey.length == 104, "Invalid public key length");
providerPublicKey[msg.sender] = publicKey;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/test_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_invalid_initiate_ritual(coordinator, nodes, accounts, initiator):
coordinator.initiateRitual(nodes, initiator, DURATION, sender=initiator)

for node in nodes:
coordinator.setProviderPublicKey(os.urandom(48), sender=node)
coordinator.setProviderPublicKey(os.urandom(104), sender=node)
with ape.reverts("Providers must be sorted"):
coordinator.initiateRitual(nodes[1:] + [nodes[0]], initiator, DURATION, sender=initiator)

Expand All @@ -112,7 +112,7 @@ def test_invalid_initiate_ritual(coordinator, nodes, accounts, initiator):

def initiate_ritual(coordinator, erc20, flat_rate_fee_model, initiator, nodes):
for node in nodes:
coordinator.setProviderPublicKey(os.urandom(48), sender=node)
coordinator.setProviderPublicKey(os.urandom(104), sender=node)
cost = flat_rate_fee_model.getRitualInitiationCost(nodes, DURATION)
erc20.approve(coordinator.address, cost, sender=initiator)
tx = coordinator.initiateRitual(nodes, initiator, DURATION, sender=initiator)
Expand Down

0 comments on commit 3021892

Please sign in to comment.