Skip to content

Commit 86488e7

Browse files
committed
fix: warnings
1 parent 111b1d1 commit 86488e7

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

omni-relayer/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use reqwest::Url;
99
use tracing::{error, info, warn};
1010
use tracing_subscriber::{EnvFilter, fmt, layer::SubscriberExt, util::SubscriberInitExt};
1111

12+
#[allow(dead_code)]
1213
mod config;
1314
mod startup;
1415
mod types;

omni-relayer/src/startup/event_handlers.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ use crate::{
1919
workers::{self, RetryableEvent},
2020
};
2121

22-
pub(super) const OMNI_EVENTS: &str = "omni_events";
23-
2422
fn near_event_key(origin_transaction_id: &str, origin_nonce: u64) -> String {
2523
utils::redis::composite_key(&[origin_transaction_id, &origin_nonce.to_string()])
2624
}

omni-relayer/src/startup/mongo_ingestion.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ use tracing::{info, warn};
66

77
use crate::{config, utils};
88

9-
use super::event_handlers::{OMNI_EVENTS, handle_meta_event, handle_transaction_event};
9+
use super::event_handlers::{handle_meta_event, handle_transaction_event};
10+
11+
const OMNI_EVENTS: &str = "omni_events";
1012

1113
async fn watch_omni_events_collection(
1214
collection: &Collection<OmniEvent>,

omni-relayer/src/startup/native_indexers/near.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,19 @@ fn is_nep_locker_event(config: &config::Config, receipt: &ReceiptView) -> bool {
215215
})
216216
)
217217
}
218+
219+
pub async fn get_final_block(jsonrpc_client: &JsonRpcClient) -> Result<u64> {
220+
info!("Getting final block");
221+
222+
let block_response = RpcBlockRequest {
223+
block_reference: near_primitives::types::BlockReference::Finality(
224+
near_primitives::types::Finality::Final,
225+
),
226+
};
227+
228+
jsonrpc_client
229+
.call(block_response)
230+
.await
231+
.map(|block| block.header.height)
232+
.map_err(Into::into)
233+
}

omni-relayer/src/utils/near.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use anyhow::{Context, Result};
44
use tracing::{info, warn};
55

66
use near_crypto::{InMemorySigner, Signer};
7-
use near_jsonrpc_client::{JsonRpcClient, methods::block::RpcBlockRequest};
7+
use near_jsonrpc_client::JsonRpcClient;
88
use near_primitives::{hash::CryptoHash, types::AccountId};
99
use omni_types::ChainKind;
1010

@@ -53,22 +53,6 @@ pub fn get_signer(
5353
}
5454
}
5555

56-
pub async fn get_final_block(jsonrpc_client: &JsonRpcClient) -> Result<u64> {
57-
info!("Getting final block");
58-
59-
let block_response = RpcBlockRequest {
60-
block_reference: near_primitives::types::BlockReference::Finality(
61-
near_primitives::types::Finality::Final,
62-
),
63-
};
64-
65-
jsonrpc_client
66-
.call(block_response)
67-
.await
68-
.map(|block| block.header.height)
69-
.map_err(Into::into)
70-
}
71-
7256
pub async fn resolve_tx_action(
7357
jsonrpc_client: &JsonRpcClient,
7458
tx_hash: CryptoHash,

0 commit comments

Comments
 (0)