Skip to content

Commit

Permalink
Include IPINFO_API_TOKEN in nightly CI (#5285)
Browse files Browse the repository at this point in the history
* Include IPINFO_API_TOKEN in nightly CI

* Fix beta clippy
  • Loading branch information
neacsu authored Dec 18, 2024
1 parent 3695332 commit 3521f36
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 72 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
IPINFO_API_TOKEN: ${{ secrets.IPINFO_API_TOKEN }}
continue-on-error: true
steps:
- name: Check out repository code
Expand Down
21 changes: 10 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ members = [
"tools/internal/contract-state-importer/importer-cli",
"tools/internal/contract-state-importer/importer-contract",
"tools/internal/testnet-manager",
"tools/internal/testnet-manager/dkg-bypass-contract", "common/verloc", "tools/internal/mixnet-connectivity-check",
"tools/internal/testnet-manager/dkg-bypass-contract",
"common/verloc",
"tools/internal/mixnet-connectivity-check",
]

default-members = [
Expand Down Expand Up @@ -403,7 +405,7 @@ indexed_db_futures = { git = "https://github.com/TiemenSch/rust-indexed-db", bra
js-sys = "0.3.70"
serde-wasm-bindgen = "0.6.5"
tsify = "0.4.5"
wasm-bindgen = "0.2.95"
wasm-bindgen = "0.2.99"
wasm-bindgen-futures = "0.4.45"
wasmtimer = "0.2.0"
web-sys = "0.3.72"
Expand Down
2 changes: 1 addition & 1 deletion common/client-core/src/init/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ where
Ok(GatewayWithLatency::new(gateway, avg))
}

pub async fn choose_gateway_by_latency<'a, R: Rng, G: ConnectableGateway + Clone>(
pub async fn choose_gateway_by_latency<R: Rng, G: ConnectableGateway + Clone>(
rng: &mut R,
gateways: &[G],
must_use_tls: bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use futures::{Sink, Stream};
use rand::{CryptoRng, RngCore};
use tungstenite::Message as WsMessage;

impl<'a, S, R> State<'a, S, R> {
impl<S, R> State<'_, S, R> {
async fn client_handshake_inner(&mut self) -> Result<(), HandshakeError>
where
S: Stream<Item = WsItem> + Sink<WsMessage> + Unpin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::registration::handshake::{error::HandshakeError, WsItem};
use futures::{Sink, Stream};
use tungstenite::Message as WsMessage;

impl<'a, S, R> State<'a, S, R> {
impl<S, R> State<'_, S, R> {
async fn gateway_handshake_inner(
&mut self,
raw_init_message: Vec<u8>,
Expand Down
5 changes: 1 addition & 4 deletions common/nym_offline_compact_ecash/src/scheme/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ pub fn aggregate_signatures(
let params = ecash_group_parameters();
// aggregate the signature

let signature = match Aggregatable::aggregate(signatures, indices) {
Ok(res) => res,
Err(err) => return Err(err),
};
let signature = Aggregatable::aggregate(signatures, indices)?;

// Ensure the aggregated signature is not an infinity point
if bool::from(signature.is_at_infinity()) {
Expand Down
4 changes: 2 additions & 2 deletions common/statistics/src/clients/packet_statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ impl PacketStatisticsControl {
while self
.history
.front()
.map_or(false, |&(t, _)| t < recording_window)
.is_some_and(|&(t, _)| t < recording_window)
{
self.history.pop_front();
}
Expand Down Expand Up @@ -462,7 +462,7 @@ impl PacketStatisticsControl {
while self
.rates
.front()
.map_or(false, |&(t, _)| t < recording_window)
.is_some_and(|&(t, _)| t < recording_window)
{
self.rates.pop_front();
}
Expand Down
4 changes: 1 addition & 3 deletions explorer-api/src/gateways/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ impl ThreadsafeGatewayCache {
.read()
.await
.get(&identity_key)
.map_or(false, |cache_item| {
cache_item.valid_until > SystemTime::now()
})
.is_some_and(|cache_item| cache_item.valid_until > SystemTime::now())
}

pub(crate) async fn get_locations(&self) -> GatewayLocationCache {
Expand Down
4 changes: 1 addition & 3 deletions explorer-api/src/mix_nodes/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ impl ThreadsafeMixNodesCache {
.read()
.await
.get(&mix_id)
.map_or(false, |cache_item| {
cache_item.valid_until > SystemTime::now()
})
.is_some_and(|cache_item| cache_item.valid_until > SystemTime::now())
}

pub(crate) async fn get_locations(&self) -> MixnodeLocationCache {
Expand Down
4 changes: 1 addition & 3 deletions explorer-api/src/unstable/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ impl ThreadSafeNymNodesCache {
.read()
.await
.get(&node_id)
.map_or(false, |cache_item| {
cache_item.valid_until > SystemTime::now()
})
.is_some_and(|cache_item| cache_item.valid_until > SystemTime::now())
}

pub(crate) async fn get_bonded_nymnodes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ pub(crate) struct ChainWritePermit<'a> {
inner: RwLockWriteGuard<'a, DirectSigningHttpRpcNyxdClient>,
}

impl<'a> ChainWritePermit<'a> {
impl ChainWritePermit<'_> {
pub(crate) async fn make_deposits(
self,
short_sha: &'static str,
Expand Down
2 changes: 1 addition & 1 deletion nym-node/src/node/http/router/api/v1/metrics/prometheus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use nym_metrics::metrics;
("prometheus_token" = [])
)
)]
pub(crate) async fn prometheus_metrics<'a>(
pub(crate) async fn prometheus_metrics(
TypedHeader(authorization): TypedHeader<Authorization<Bearer>>,
State(state): State<MetricsAppState>,
) -> Result<String, StatusCode> {
Expand Down
26 changes: 13 additions & 13 deletions tools/internal/testnet-manager/src/manager/dkg_skip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ impl NetworkManager {
Ok(())
}

async fn validate_existing_contracts<'a>(
async fn validate_existing_contracts(
&self,
ctx: &DkgSkipCtx<'a>,
ctx: &DkgSkipCtx<'_>,
) -> Result<ContractCodeId, NetworkManagerError> {
ctx.println(format!(
"🔬 {}Validating the current DKG and group contracts...",
Expand Down Expand Up @@ -215,9 +215,9 @@ impl NetworkManager {
Ok(current_code)
}

async fn persist_dkg_keys<'a, P: AsRef<Path>>(
async fn persist_dkg_keys<P: AsRef<Path>>(
&self,
ctx: &mut DkgSkipCtx<'a>,
ctx: &mut DkgSkipCtx<'_>,
output_dir: P,
) -> Result<(), NetworkManagerError> {
ctx.println(format!(
Expand Down Expand Up @@ -272,9 +272,9 @@ impl NetworkManager {
Ok(())
}

async fn upload_bypass_contract<'a, P: AsRef<Path>>(
async fn upload_bypass_contract<P: AsRef<Path>>(
&self,
ctx: &DkgSkipCtx<'a>,
ctx: &DkgSkipCtx<'_>,
dkg_bypass_contract: P,
) -> Result<ContractCodeId, NetworkManagerError> {
ctx.println(format!(
Expand All @@ -297,9 +297,9 @@ impl NetworkManager {
Ok(res.code_id)
}

async fn migrate_to_bypass_contract<'a>(
async fn migrate_to_bypass_contract(
&self,
ctx: &DkgSkipCtx<'a>,
ctx: &DkgSkipCtx<'_>,
code_id: ContractCodeId,
) -> Result<(), NetworkManagerError> {
ctx.println(format!(
Expand Down Expand Up @@ -336,9 +336,9 @@ impl NetworkManager {
Ok(())
}

async fn restore_dkg_contract<'a>(
async fn restore_dkg_contract(
&self,
ctx: &DkgSkipCtx<'a>,
ctx: &DkgSkipCtx<'_>,
code_id: ContractCodeId,
) -> Result<(), NetworkManagerError> {
ctx.println(format!(
Expand All @@ -363,7 +363,7 @@ impl NetworkManager {
Ok(())
}

async fn add_group_members<'a>(&self, ctx: &DkgSkipCtx<'a>) -> Result<(), NetworkManagerError> {
async fn add_group_members(&self, ctx: &DkgSkipCtx<'_>) -> Result<(), NetworkManagerError> {
ctx.println(format!(
"👪 {}Adding all the cw4 group members...",
style("[7/8]").bold().dim()
Expand All @@ -387,9 +387,9 @@ impl NetworkManager {
Ok(())
}

async fn transfer_signer_tokens<'a>(
async fn transfer_signer_tokens(
&self,
ctx: &DkgSkipCtx<'a>,
ctx: &DkgSkipCtx<'_>,
) -> Result<(), NetworkManagerError> {
ctx.println(format!(
"💸 {}Transferring tokens to the new signers...",
Expand Down
6 changes: 3 additions & 3 deletions tools/internal/testnet-manager/src/manager/local_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ impl NetworkManager {
.join(DEFAULT_CONFIG_FILENAME)
}

async fn initialise_api<'a>(
async fn initialise_api(
&self,
ctx: &LocalApisCtx<'a>,
ctx: &LocalApisCtx<'_>,
info: &EcashSignerWithPaths,
) -> Result<(), NetworkManagerError> {
let address = &info.data.cosmos_account.address;
Expand Down Expand Up @@ -139,7 +139,7 @@ impl NetworkManager {
Ok(())
}

async fn initialise_apis<'a>(&self, ctx: &LocalApisCtx<'a>) -> Result<(), NetworkManagerError> {
async fn initialise_apis(&self, ctx: &LocalApisCtx<'_>) -> Result<(), NetworkManagerError> {
ctx.println(format!(
"🔏 {}Initialising local nym-apis...",
style("[1/1]").bold().dim()
Expand Down
17 changes: 7 additions & 10 deletions tools/internal/testnet-manager/src/manager/local_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ impl NetworkManager {
.join(DEFAULT_CONFIG_FILENAME)
}

async fn wait_for_api_gateway<'a>(
async fn wait_for_api_gateway(
&self,
ctx: &LocalClientCtx<'a>,
ctx: &LocalClientCtx<'_>,
) -> Result<SocketAddr, NetworkManagerError> {
// create api client
// hehe, that's disgusting, but it's not meant to be used by users
Expand Down Expand Up @@ -145,9 +145,9 @@ impl NetworkManager {
}
}

async fn wait_for_gateway_endpoint<'a>(
async fn wait_for_gateway_endpoint(
&self,
ctx: &LocalClientCtx<'a>,
ctx: &LocalClientCtx<'_>,
gateway: SocketAddr,
) -> Result<(), NetworkManagerError> {
ctx.set_pb_message(format!(
Expand Down Expand Up @@ -177,17 +177,14 @@ impl NetworkManager {
Ok(())
}

async fn wait_for_gateway<'a>(
&self,
ctx: &LocalClientCtx<'a>,
) -> Result<(), NetworkManagerError> {
async fn wait_for_gateway(&self, ctx: &LocalClientCtx<'_>) -> Result<(), NetworkManagerError> {
let endpoint = self.wait_for_api_gateway(ctx).await?;
self.wait_for_gateway_endpoint(ctx, endpoint).await
}

async fn prepare_nym_client<'a>(
async fn prepare_nym_client(
&self,
ctx: &LocalClientCtx<'a>,
ctx: &LocalClientCtx<'_>,
) -> Result<(), NetworkManagerError> {
ctx.println(format!(
"🔏 {}Initialising local nym-client...",
Expand Down
Loading

0 comments on commit 3521f36

Please sign in to comment.