|
27 | 27 | from src.utils.cache import global_lru_cache as lru_cache
|
28 | 28 | from src.web3py.types import Web3
|
29 | 29 |
|
30 |
| - |
31 | 30 | logger = logging.getLogger(__name__)
|
32 | 31 |
|
33 |
| - |
34 | 32 | # Initial epoch is in the future. Revert signature: '0xcd0883ea'
|
35 | 33 | InitialEpochIsYetToArriveRevert = Web3.keccak(text="InitialEpochIsYetToArrive()")[:4].hex()
|
36 | 34 |
|
@@ -135,25 +133,29 @@ def get_member_info(self, blockstamp: BlockStamp) -> MemberInfo:
|
135 | 133 | current_frame_consensus_report = current_frame_member_report = ZERO_HASH
|
136 | 134 |
|
137 | 135 | if variables.ACCOUNT:
|
138 |
| - ( |
139 |
| - # Current frame's reference slot. |
140 |
| - _, # current_frame_ref_slot |
141 |
| - # Consensus report for the current frame, if any. Zero bytes otherwise. |
142 |
| - current_frame_consensus_report, |
143 |
| - # Whether the provided address is a member of the oracle committee. |
144 |
| - is_member, |
145 |
| - # Whether the oracle committee member is in the fast line members subset of the current reporting frame. |
146 |
| - is_fast_lane, |
147 |
| - # Whether the oracle committee member is allowed to submit a report at the moment of the call. |
148 |
| - _, # can_report |
149 |
| - # The last reference slot for which the member submitted a report. |
150 |
| - last_member_report_ref_slot, |
151 |
| - # The hash reported by the member for the current frame, if any. |
152 |
| - current_frame_member_report, |
153 |
| - ) = consensus_contract.get_consensus_state_for_member( |
154 |
| - variables.ACCOUNT.address, |
155 |
| - blockstamp.block_hash, |
156 |
| - ) |
| 136 | + try: |
| 137 | + ( |
| 138 | + # Current frame's reference slot. |
| 139 | + _, # current_frame_ref_slot |
| 140 | + # Consensus report for the current frame, if any. Zero bytes otherwise. |
| 141 | + current_frame_consensus_report, |
| 142 | + # Whether the provided address is a member of the oracle committee. |
| 143 | + is_member, |
| 144 | + # Whether the oracle committee member is in the fast line members subset of the current reporting frame. |
| 145 | + is_fast_lane, |
| 146 | + # Whether the oracle committee member is allowed to submit a report at the moment of the call. |
| 147 | + _, # can_report |
| 148 | + # The last reference slot for which the member submitted a report. |
| 149 | + last_member_report_ref_slot, |
| 150 | + # The hash reported by the member for the current frame, if any. |
| 151 | + current_frame_member_report, |
| 152 | + ) = consensus_contract.get_consensus_state_for_member( |
| 153 | + variables.ACCOUNT.address, |
| 154 | + blockstamp.block_hash, |
| 155 | + ) |
| 156 | + except ContractCustomError as revert: |
| 157 | + if revert.data != InitialEpochIsYetToArriveRevert: |
| 158 | + raise revert |
157 | 159 |
|
158 | 160 | is_submit_member = self._is_submit_member(blockstamp)
|
159 | 161 |
|
|
0 commit comments