Skip to content

Commit

Permalink
Fix CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
kisialiou committed Dec 19, 2024
1 parent a570074 commit 0de74cb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions near/omni-prover/evm-prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>) -> Result<Promise, String> {
Expand Down Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions near/omni-prover/omni-prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>()
}
Expand Down
11 changes: 8 additions & 3 deletions omni-relayer/src/startup/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions omni-relayer/src/utils/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0de74cb

Please sign in to comment.