Skip to content

Commit

Permalink
Add uncompressed public key mock
Browse files Browse the repository at this point in the history
  • Loading branch information
cyc60 committed Feb 6, 2024
1 parent fce253f commit a24ea16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sw-utils"
version = "0.6.3"
version = "0.6.4"
description = "StakeWise Python utils"
authors = ["StakeWise Labs <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down
9 changes: 8 additions & 1 deletion sw_utils/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def eth_public_key(self) -> str:
# 48 bytes
return '0x' + ''.join(random.choices('abcdef' + string.digits, k=96))

def eth_uncompressed_public_key(self) -> str:
# 128 bytes
return '0x' + ''.join(random.choices('abcdef' + string.digits, k=128))

def wei_amount(self, start: int = 10, stop: int = 1000) -> Wei:
eth_value = faker.random_int(start, stop)
return w3.to_wei(eth_value, 'ether')
Expand Down Expand Up @@ -63,7 +67,10 @@ def get_mocked_protocol_config(
return ProtocolConfig(
oracles=oracles
or [
Oracle(public_key=faker.eth_public_key(), endpoints=[f'https://example{i}.com'])
Oracle(
public_key=faker.eth_uncompressed_public_key(),
endpoints=[f'https://example{i}.com'],
)
for i in range(oracles_count)
],
supported_relays=[
Expand Down

0 comments on commit a24ea16

Please sign in to comment.