Skip to content

Commit

Permalink
Fix rust-analyzer warnings (#3974)
Browse files Browse the repository at this point in the history
* Fix rust-analyzer warnings

Fix some warnings that rust-analyzer emits due to enabling all features.
These are annoying when you try to list all warnings in the entire
workspace.

* Revert change to signing client

* Instead add nested feature
  • Loading branch information
octol authored Oct 10, 2023
1 parent 7577ec9 commit fb2b7d3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions common/client-libs/validator-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ required-features = ["http-client"]
default = ["http-client"]
http-client = ["cosmrs/rpc", "openssl"]
generate-ts = []
contract-testing = ["nym-mixnet-contract-common/contract-testing"]

Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,14 @@ pub trait MixnetSigningClient {
.await
}

#[cfg(feature = "nym_mixnet_contract_common/contract-testing")]
#[cfg(feature = "contract-testing")]
async fn testing_resolve_all_pending_events(
&self,
fee: Option<Fee>,
) -> Result<ExecuteResult, NyxdError> {
self.execute_mixnet_contract(
fee,
MixnetExecuteMsg::TestingResolveAllPendingEvents {},
MixnetExecuteMsg::TestingResolveAllPendingEvents { limit: None },
vec![],
)
.await
Expand Down Expand Up @@ -928,8 +929,8 @@ mod tests {
.withdraw_delegator_reward_on_behalf(owner.parse().unwrap(), mix_id, None)
.ignore(),

#[cfg(feature = "nym_mixnet_contract_common/contract-testing")]
MixnetExecuteMsg::TestingResolveAllPendingEvents {} => {
#[cfg(feature = "contract-testing")]
MixnetExecuteMsg::TestingResolveAllPendingEvents { .. } => {
client.testing_resolve_all_pending_events(None).ignore()
}
};
Expand Down
3 changes: 1 addition & 2 deletions sdk/rust/nym-sdk/examples/libp2p_ping/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use libp2p::ping::Success;
use libp2p::swarm::{keep_alive, NetworkBehaviour, SwarmEvent};
use libp2p::{identity, ping, Multiaddr, PeerId};
use log::{debug, info, LevelFilter};
use nym_sdk::mixnet::MixnetClient;
use std::error::Error;
use std::time::Duration;

Expand All @@ -70,7 +69,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
use libp2p::swarm::SwarmBuilder;
use rust_libp2p_nym::transport::NymTransport;

let client = MixnetClient::connect_new().await.unwrap();
let client = nym_sdk::mixnet::MixnetClient::connect_new().await.unwrap();

let transport = NymTransport::new(client, local_key.clone()).await?;
SwarmBuilder::with_tokio_executor(
Expand Down
1 change: 1 addition & 0 deletions sdk/rust/nym-sdk/examples/libp2p_shared/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub struct NymTransport {

impl NymTransport {
/// New transport.
#[allow(unused)]
pub async fn new(client: MixnetClient, keypair: Keypair) -> Result<Self, Error> {
Self::new_maybe_with_notify_inbound(client, keypair, None, None).await
}
Expand Down

0 comments on commit fb2b7d3

Please sign in to comment.