Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ unexpected_cfgs = { level = "allow", check-cfg = [
assertions_on_result_states = "warn"
allow_attributes = "warn"
mod_module_files = "deny"
wildcard_imports = "deny"

[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"
Expand Down
7 changes: 5 additions & 2 deletions crates/contract/src/crypto_shared/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ impl TryFrom<dtos::PublicKey> for PublicKeyExtended {
}

pub mod k256_types {
use super::*;
use super::{
AffinePoint, BorshDeserialize, BorshSerialize, CurveArithmetic, Deserialize, PrimeField,
Secp256k1, Serialize,
};
use k256::Scalar;

pub type PublicKey = <Secp256k1 as CurveArithmetic>::AffinePoint;
Expand Down Expand Up @@ -249,7 +252,7 @@ pub mod k256_types {
}

pub mod ed25519_types {
use super::*;
use super::{BorshDeserialize, BorshSerialize, Deserialize, PrimeField, Serialize, serde_as};
use curve25519_dalek::Scalar;

// Is there a better way to force a borsh serialization?
Expand Down
5 changes: 4 additions & 1 deletion crates/contract/src/dto_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,10 @@ impl TryFrom<near_mpc_contract_interface::types::Config> for Config {
// Gated behind `test-utils` so they stay out of the production/WASM surface.
#[cfg(feature = "test-utils")]
mod test_conversions {
use super::*;
use super::{
GovernanceThresholdParameters, IntoContractType, IntoInterfaceType, ParticipantInfo,
ProposedGovernanceThresholdParameters, ProtocolContractState, dtos,
};

impl From<ProtocolContractState> for dtos::ProtocolContractState {
fn from(state: ProtocolContractState) -> Self {
Expand Down
8 changes: 6 additions & 2 deletions crates/devnet/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ pub mod near_crypto_compatible_serialization {
const ED25519_PREFIX: &str = "ed25519";

pub mod signing_keys {
use super::*;
use super::{
Deserialize, Deserializer, ED25519_PREFIX, Serialize, Serializer, SigningKey, de,
};

pub fn serialize<S>(keys: &[SigningKey], serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down Expand Up @@ -264,7 +266,9 @@ pub mod near_crypto_compatible_serialization {
pub mod verifying_key {
use anyhow::Context;

use super::*;
use super::{
Deserialize, Deserializer, ED25519_PREFIX, Serialize, Serializer, VerifyingKey, de,
};

pub fn serialize<S>(key: &VerifyingKey, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down
10 changes: 5 additions & 5 deletions crates/near-mpc-bounded-collections/src/bounded_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ impl<T, const L: usize, const U: usize> OptBoundedVecToVec<T>
}

mod borsh_impl {
use super::*;
use super::{BoundedVec, witnesses};
use borsh::{BorshDeserialize, BorshSerialize};

impl<T: BorshSerialize, const L: usize, const U: usize, W> BorshSerialize
Expand Down Expand Up @@ -632,7 +632,7 @@ mod borsh_impl {

#[cfg(feature = "abi")]
mod schema {
use super::*;
use super::BoundedVec;
use borsh::BorshSchema;
use borsh::schema::{Declaration, Definition, add_definition};
use std::collections::BTreeMap;
Expand All @@ -656,7 +656,7 @@ mod borsh_impl {
}

mod serde_impl {
use super::*;
use super::{BoundedVec, TryFrom, UpperBoundedVec};
use serde::{Deserialize, Serialize};

// direct impl to unify serde in one place instead of doing attribute on declaration and deserialize here
Expand Down Expand Up @@ -693,7 +693,7 @@ mod serde_impl {

#[cfg(all(feature = "abi", not(target_arch = "wasm32")))]
mod schema {
use super::*;
use super::{BoundedVec, TryFrom};
use schemars::JsonSchema;

impl<T: JsonSchema, const L: usize, const U: usize, W> JsonSchema for BoundedVec<T, L, U, W> {
Expand Down Expand Up @@ -739,7 +739,7 @@ mod serde_impl {
/// }
/// ```
pub mod hex_serde {
use super::*;
use super::{BoundedVec, BoundedVecOutOfBounds, TryFrom, TryInto};
use serde::Deserialize;

#[cfg(all(feature = "abi", not(target_arch = "wasm32")))]
Expand Down