Skip to content

Commit

Permalink
chore: Remove derivative dependency and fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Dec 5, 2024
1 parent e63f3d6 commit 26c894d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion sylvia-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sylvia-derive/src/parser/check_generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand Down
1 change: 0 additions & 1 deletion sylvia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion sylvia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 10 additions & 4 deletions sylvia/src/multitest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,27 @@ 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<MtApp>,
pub _phantom: std::marker::PhantomData<(MtApp, Contract)>,
}

impl<MtApp: core::fmt::Debug, Contract: core::fmt::Debug> 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)

Check warning on line 84 in sylvia/src/multitest.rs

View check run for this annotation

Codecov / codecov/patch

sylvia/src/multitest.rs#L82-L84

Added lines #L82 - L84 were not covered by tests
.finish()
}
}

impl<'a, MtApp, Contract> Proxy<'a, MtApp, Contract> {
pub fn new(contract_addr: cosmwasm_std::Addr, app: &'a App<MtApp>) -> Self {
Proxy {
Expand Down
6 changes: 2 additions & 4 deletions sylvia/src/types.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -368,8 +367,7 @@ impl ExecutorBuilder<ReadyExecutorBuilderState> {
///
/// 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)]
Expand Down Expand Up @@ -452,7 +450,7 @@ impl<'a, Contract: ?Sized> Remote<'a, Contract> {
}
}

impl<'a, Contract: ?Sized> AsRef<cosmwasm_std::Addr> for Remote<'a, Contract> {
impl<Contract: ?Sized> AsRef<cosmwasm_std::Addr> for Remote<'_, Contract> {
/// Returns reference to the underlying contract address.
fn as_ref(&self) -> &cosmwasm_std::Addr {
&self.addr
Expand Down

0 comments on commit 26c894d

Please sign in to comment.