diff --git a/.catalog-info.yaml b/.catalog-info.yaml index 018e9ce5..f658b185 100644 --- a/.catalog-info.yaml +++ b/.catalog-info.yaml @@ -11,5 +11,5 @@ spec: - ./near/omni-prover/wormhole-omni-prover-proxy/.catalog-info.yaml - ./near/omni-types/.catalog-info.yaml - ./near/omni-bridge/.catalog-info.yaml - - ./evm/bridge-token-factory/.catalog-info.yaml + - ./evm/src/omni-bridge/.catalog-info.yaml - ./omni-relayer/.catalog-info.yaml diff --git a/near/omni-prover/evm-prover/src/lib.rs b/near/omni-prover/evm-prover/src/lib.rs index 2ec2d06d..69a07964 100644 --- a/near/omni-prover/evm-prover/src/lib.rs +++ b/near/omni-prover/evm-prover/src/lib.rs @@ -46,6 +46,10 @@ impl EvmProver { /// /// This function will panic in the following situations: /// - If the log entry at the specified index doesn't match the decoded log entry. + /// + /// # Errors + /// + /// This function will return an error if the proof is invalid. #[allow(clippy::needless_pass_by_value)] #[handle_result] pub fn verify_proof(&self, #[serializer(borsh)] input: Vec) -> Result { @@ -87,6 +91,9 @@ impl EvmProver { )) } + /// # Errors + /// + /// This function will return an error if the block hash is not valid. #[allow(clippy::needless_pass_by_value)] #[private] #[handle_result] diff --git a/near/omni-prover/omni-prover/src/lib.rs b/near/omni-prover/omni-prover/src/lib.rs index 283d83c9..5a664616 100644 --- a/near/omni-prover/omni-prover/src/lib.rs +++ b/near/omni-prover/omni-prover/src/lib.rs @@ -72,6 +72,7 @@ impl OmniProver { self.provers.remove(&prover_id); } + #[must_use] pub fn get_provers(&self) -> Vec<(ProverId, AccountId)> { self.provers.iter().collect::>() } diff --git a/omni-relayer/src/startup/eth.rs b/omni-relayer/src/startup/eth.rs index 985406d7..4ad08082 100644 --- a/omni-relayer/src/startup/eth.rs +++ b/omni-relayer/src/startup/eth.rs @@ -85,9 +85,13 @@ pub async fn start_indexer( .address(config.eth.bridge_token_factory_address) .event_signature([FinTransfer::SIGNATURE_HASH, InitTransfer::SIGNATURE_HASH].to_vec()); - for current_block in - (from_block..latest_block).step_by(config.eth.block_processing_batch_size as usize) - { + for current_block in (from_block..latest_block).step_by( + config + .eth + .block_processing_batch_size + .try_into() + .unwrap_or(usize::MAX), + ) { let logs = http_provider .get_logs(&filter.clone().from_block(current_block).to_block( (current_block + config.eth.block_processing_batch_size).min(latest_block), @@ -157,6 +161,7 @@ pub async fn start_indexer( Ok(()) } +#[allow(clippy::too_many_lines)] async fn process_log( config: &config::Config, redis_connection: &mut redis::aio::MultiplexedConnection, diff --git a/omni-relayer/src/utils/fee.rs b/omni-relayer/src/utils/fee.rs index 791d265f..83dd9c59 100644 --- a/omni-relayer/src/utils/fee.rs +++ b/omni-relayer/src/utils/fee.rs @@ -60,6 +60,8 @@ pub async fn is_fee_sufficient(jsonrpc_client: &JsonRpcClient, sender: &OmniAddr let token_price = get_price_by_contract_address("near-protocol", token.as_ref()).await?; let token_decimals = get_token_decimals(jsonrpc_client, token).await?; + #[allow(clippy::cast_precision_loss)] + #[allow(clippy::as_conversions)] let given_fee = fee as f64 / 10u128.pow(token_decimals) as f64 * token_price; // TODO: Right now I chose a random fee (around 0.10 USD), but it should be calculated based on the chain in the future