|
1 | 1 | use crate::eth::{BlockNumberOrTag, EthError, Filter as EthFilter, Provider}; |
2 | 2 | use alloy::rpc::types::request::{TransactionInput, TransactionRequest}; |
3 | | -use alloy_primitives::{Address, Bytes, FixedBytes, U256, B256, keccak256}; |
| 3 | +use alloy_primitives::{keccak256, Address, Bytes, FixedBytes, B256, U256}; |
4 | 4 | use alloy_sol_macro::sol; |
5 | 5 | use alloy_sol_types::{SolCall, SolEvent}; |
6 | 6 |
|
@@ -109,20 +109,23 @@ impl DaoContracts { |
109 | 109 |
|
110 | 110 | /// Fetch role IDs from the timelock. |
111 | 111 | pub fn roles(&self) -> Result<(FixedBytes<32>, FixedBytes<32>, FixedBytes<32>), EthError> { |
112 | | - let proposer = self.call_view(self.timelock, TimelockController::PROPOSER_ROLECall {})?._0; |
113 | | - let executor = self.call_view(self.timelock, TimelockController::EXECUTOR_ROLECall {})?._0; |
114 | | - let canceller = self.call_view(self.timelock, TimelockController::CANCELLER_ROLECall {})?._0; |
| 112 | + let proposer = self |
| 113 | + .call_view(self.timelock, TimelockController::PROPOSER_ROLECall {})? |
| 114 | + ._0; |
| 115 | + let executor = self |
| 116 | + .call_view(self.timelock, TimelockController::EXECUTOR_ROLECall {})? |
| 117 | + ._0; |
| 118 | + let canceller = self |
| 119 | + .call_view(self.timelock, TimelockController::CANCELLER_ROLECall {})? |
| 120 | + ._0; |
115 | 121 | Ok((proposer, executor, canceller)) |
116 | 122 | } |
117 | 123 |
|
118 | 124 | /// Check if an account has a specific timelock role. |
119 | 125 | pub fn has_role(&self, role: FixedBytes<32>, account: Address) -> Result<bool, EthError> { |
120 | 126 | let res = self.call_view( |
121 | 127 | self.timelock, |
122 | | - TimelockController::hasRoleCall { |
123 | | - role, |
124 | | - account, |
125 | | - }, |
| 128 | + TimelockController::hasRoleCall { role, account }, |
126 | 129 | )?; |
127 | 130 | Ok(res._0) |
128 | 131 | } |
@@ -290,9 +293,7 @@ impl DaoContracts { |
290 | 293 | let mut out = Vec::new(); |
291 | 294 | for log in logs { |
292 | 295 | let prim_log = log.inner.clone(); |
293 | | - if let Ok(decoded) = |
294 | | - HyperwareGovernor::ProposalCreated::decode_log(&prim_log, true) |
295 | | - { |
| 296 | + if let Ok(decoded) = HyperwareGovernor::ProposalCreated::decode_log(&prim_log, true) { |
296 | 297 | out.push(ProposalCreatedEvent { |
297 | 298 | proposal_id: decoded.proposalId, |
298 | 299 | proposer: decoded.proposer, |
|
0 commit comments