diff --git a/Cargo.lock b/Cargo.lock index 1eff1db7..3b43b2fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "ahash" @@ -1120,7 +1120,6 @@ dependencies = [ "cw-multi-test", "cw-storage-plus", "cw-utils", - "derivative", "itertools 0.13.0", "konst", "schemars", diff --git a/Cargo.toml b/Cargo.toml index 897d17ce..738347a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,15 +7,15 @@ resolver = "2" version = "1.3.1" [workspace.dependencies] -sylvia-derive = { version = "1.3.1", path = "sylvia-derive" } anyhow = "1.0.93" cosmwasm-schema = "2.1.4" cosmwasm-std = "2.1.4" cw-multi-test = "2.2.0" cw-storage-plus = "2.0.0" -schemars = "0.8.21" cw-utils = "2.0.0" +schemars = "0.8.21" serde = { version = "1.0.214", default-features = false, features = ["derive"] } +sylvia-derive = { version = "1.3.1", path = "sylvia-derive" } thiserror = "2.0.0" [workspace.metadata.docs.rs] diff --git a/examples/Cargo.lock b/examples/Cargo.lock index 27e54e46..d9bbdf21 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "ahash" @@ -1272,7 +1272,6 @@ dependencies = [ "cosmwasm-std", "cw-multi-test", "cw-utils", - "derivative", "konst", "schemars", "serde", diff --git a/sylvia-derive/src/lib.rs b/sylvia-derive/src/lib.rs index 8f708ff9..934d7ef7 100644 --- a/sylvia-derive/src/lib.rs +++ b/sylvia-derive/src/lib.rs @@ -717,7 +717,7 @@ fn contract_impl(attr: TokenStream2, item: TokenStream2) -> TokenStream2 { let input = StripInput.fold_item_impl(input); Ok(quote! { - #[cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))] + #[allow(clippy::new_without_default)] #input #expanded diff --git a/sylvia-derive/src/parser/check_generics.rs b/sylvia-derive/src/parser/check_generics.rs index d6e96e0d..eb3e0947 100644 --- a/sylvia-derive/src/parser/check_generics.rs +++ b/sylvia-derive/src/parser/check_generics.rs @@ -89,7 +89,7 @@ where } } -impl<'ast, 'g, Generic> Visit<'ast> for CheckGenerics<'g, Generic> +impl<'ast, Generic> Visit<'ast> for CheckGenerics<'_, Generic> where Generic: GetPath + PartialEq, { diff --git a/sylvia/Cargo.toml b/sylvia/Cargo.toml index 754ca0ed..ab2f3c24 100644 --- a/sylvia/Cargo.toml +++ b/sylvia/Cargo.toml @@ -49,7 +49,6 @@ serde-json-wasm = "1.0.1" konst = "0.3.8" cw-multi-test = { workspace = true, features = ["staking"], optional = true } anyhow = { workspace = true, optional = true } -derivative = { version = "2.2.0" } cw-utils = { workspace = true } [dev-dependencies] diff --git a/sylvia/src/lib.rs b/sylvia/src/lib.rs index 70e171ab..9ddfe524 100644 --- a/sylvia/src/lib.rs +++ b/sylvia/src/lib.rs @@ -21,7 +21,6 @@ pub use cw_multi_test; pub use cw_utils; #[cfg_attr(docsrs, doc(cfg(feature = "mt")))] #[cfg(feature = "mt")] -pub use derivative; pub use sylvia_derive::{contract, entry_points, interface}; pub use { cosmwasm_schema as cw_schema, cosmwasm_std as cw_std, schemars, serde, diff --git a/sylvia/src/multitest.rs b/sylvia/src/multitest.rs index 7be78fd6..89c1f20f 100644 --- a/sylvia/src/multitest.rs +++ b/sylvia/src/multitest.rs @@ -65,21 +65,25 @@ use cw_multi_test::{ GovFailingModule, Ibc, IbcFailingModule, Module, Router, StakeKeeper, Staking, Stargate, StargateFailing, Wasm, WasmKeeper, }; -use derivative::Derivative; use serde::Serialize; use crate::types::{CustomMsg, CustomQuery}; /// Proxy to interact with a smart contract initialized on the [App]. -#[derive(Derivative)] -#[derivative(Debug)] pub struct Proxy<'a, MtApp, Contract> { pub contract_addr: cosmwasm_std::Addr, - #[derivative(Debug = "ignore")] pub app: &'a crate::multitest::App, pub _phantom: std::marker::PhantomData<(MtApp, Contract)>, } +impl core::fmt::Debug for Proxy<'_, MtApp, Contract> { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("Proxy") + .field("contract_addr", &self.contract_addr) + .finish() + } +} + impl<'a, MtApp, Contract> Proxy<'a, MtApp, Contract> { pub fn new(contract_addr: cosmwasm_std::Addr, app: &'a App) -> Self { Proxy { diff --git a/sylvia/src/types.rs b/sylvia/src/types.rs index 3dd4b014..db5d5d7f 100644 --- a/sylvia/src/types.rs +++ b/sylvia/src/types.rs @@ -1,7 +1,6 @@ //! Module providing utilities to build and use sylvia contracts. use cosmwasm_std::{Binary, Coin, Deps, DepsMut, Empty, Env, MessageInfo, WasmMsg}; -use derivative::Derivative; use schemars::JsonSchema; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; @@ -368,8 +367,7 @@ impl ExecutorBuilder { /// /// fn main() {} /// ``` -#[derive(Serialize, Deserialize, Derivative)] -#[derivative(Clone, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] pub struct Remote<'a, Contract: ?Sized> { addr: std::borrow::Cow<'a, cosmwasm_std::Addr>, #[serde(skip)] @@ -452,7 +450,7 @@ impl<'a, Contract: ?Sized> Remote<'a, Contract> { } } -impl<'a, Contract: ?Sized> AsRef for Remote<'a, Contract> { +impl AsRef for Remote<'_, Contract> { /// Returns reference to the underlying contract address. fn as_ref(&self) -> &cosmwasm_std::Addr { &self.addr