Skip to content

Commit e704d69

Browse files
Use HexBytes in HarvestParams
1 parent aca6856 commit e704d69

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/common/harvest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from eth_typing import ChecksumAddress
2+
from hexbytes import HexBytes
23
from web3 import Web3
34
from web3.types import Wei
45

@@ -52,10 +53,10 @@ async def _fetch_harvest_params_from_ipfs(
5253
reward = Wei(vault_data['consensus_reward'])
5354

5455
return HarvestParams(
55-
rewards_root=rewards_root,
56+
rewards_root=HexBytes(rewards_root),
5657
reward=reward,
5758
unlocked_mev_reward=unlocked_mev_reward,
58-
proof=[Web3.to_bytes(hexstr=x) for x in vault_data['proof']],
59+
proof=[HexBytes(Web3.to_bytes(hexstr=x)) for x in vault_data['proof']],
5960
)
6061

6162
return None

src/common/typings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from dataclasses import dataclass
22

3+
from hexbytes import HexBytes
34
from web3.types import Wei
45

56

@@ -11,10 +12,10 @@ class RewardVoteInfo:
1112

1213
@dataclass
1314
class HarvestParams:
14-
rewards_root: bytes
15+
rewards_root: HexBytes
1516
reward: Wei
1617
unlocked_mev_reward: Wei
17-
proof: list[bytes]
18+
proof: list[HexBytes]
1819

1920

2021
@dataclass

0 commit comments

Comments
 (0)