Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make cosmwasm_schema deps obsolete #421

Merged
merged 1 commit into from
Aug 27, 2024
Merged
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
16 changes: 0 additions & 16 deletions examples/Cargo.lock

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

1 change: 0 additions & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ edition = "2021"

[workspace.dependencies]
anyhow = "1.0.86"
cosmwasm-schema = "2.1.3"
cw-multi-test = "2.1.1"
cw-storage-plus = "2.0.0"
cw-utils = "2.0.0"
Expand Down
1 change: 0 additions & 1 deletion examples/contracts/custom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ mt = ["library", "anyhow", "cw-multi-test"]

[dependencies]
cw1 = { path = "../../interfaces/cw1" }
cosmwasm-schema = { workspace = true }
cw-storage-plus = { workspace = true }
serde = { workspace = true }
sylvia = { path = "../../../sylvia" }
Expand Down
3 changes: 2 additions & 1 deletion examples/contracts/custom/src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use cosmwasm_schema::write_api;
use sylvia::cw_schema::write_api;

use custom::contract::sv::{ContractExecMsg, ContractQueryMsg, InstantiateMsg};

#[cfg(not(tarpaulin_include))]
fn main() {
write_api! {
crate_name: sylvia::cw_schema,
instantiate: InstantiateMsg,
execute: ContractExecMsg,
query: ContractQueryMsg,
Expand Down
8 changes: 4 additions & 4 deletions examples/contracts/custom/src/messages.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use cosmwasm_schema::cw_serde;
use sylvia::cw_schema::cw_serde;
use sylvia::cw_std::{CustomMsg, CustomQuery};

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct CountResponse {
pub count: u64,
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub enum CounterMsg {
Increment {},
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub enum CounterQuery {
Count {},
}
Expand Down
2 changes: 1 addition & 1 deletion examples/contracts/custom/src/multitest/custom_module.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use cosmwasm_schema::schemars::JsonSchema;
use cw_multi_test::{AppResponse, CosmosRouter, Module};
use cw_storage_plus::Item;
use serde::de::DeserializeOwned;
use std::fmt::Debug;
use sylvia::cw_schema::schemars::JsonSchema;
use sylvia::cw_std::{
to_json_binary, Addr, Api, Binary, BlockInfo, CustomQuery, Empty, Querier, StdError, StdResult,
Storage,
Expand Down
1 change: 0 additions & 1 deletion examples/contracts/cw1-subkeys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ mt = ["library", "cw-multi-test", "anyhow"]

[dependencies]
anyhow = { workspace = true, optional = true }
cosmwasm-schema = { workspace = true }
cw-multi-test = { workspace = true, optional = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion examples/contracts/cw1-subkeys/src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use cosmwasm_schema::write_api;
use cw1_subkeys::contract::sv::{ContractExecMsg, ContractQueryMsg, InstantiateMsg};
use sylvia::cw_schema::write_api;
use sylvia::cw_std::Empty;

#[cfg(not(tarpaulin_include))]
fn main() {
write_api! {
crate_name: sylvia::cw_schema,
instantiate: InstantiateMsg,
execute: ContractExecMsg<Empty, Empty>,
query: ContractQueryMsg<Empty, Empty>,
Expand Down
4 changes: 2 additions & 2 deletions examples/contracts/cw1-subkeys/src/responses.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::state::Permissions;
use cosmwasm_schema::schemars::JsonSchema;
use cw_utils::{Expiration, NativeBalance};
use serde::{Deserialize, Serialize};
use sylvia::cw_schema::schemars::JsonSchema;
use sylvia::cw_std::Addr;
use sylvia::schemars;

Expand Down Expand Up @@ -43,7 +43,7 @@ impl AllowanceInfo {
/// ```
/// # use cw_utils::{Expiration, NativeBalance};
/// # use cw1_subkeys::msg::AllowanceInfo;
/// # use cosmwasm_schema::{cw_serde, QueryResponses};
/// # use sylvia::cw_schema::{cw_serde, QueryResponses};
/// # use sylvia::cw_std::coin;
///
/// let mut allows = vec![Allowance {
Expand Down
1 change: 0 additions & 1 deletion examples/contracts/cw1-whitelist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ library = []
mt = ["sylvia/mt", "library", "cw-multi-test", "anyhow"]

[dependencies]
cosmwasm-schema = { workspace = true }
serde = { workspace = true }
sylvia = { path = "../../../sylvia" }
cw1 = { path = "../../interfaces/cw1" }
Expand Down
3 changes: 2 additions & 1 deletion examples/contracts/cw1-whitelist/src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use cosmwasm_schema::write_api;
use cw1_whitelist::contract::sv::{ContractExecMsg, ContractQueryMsg, InstantiateMsg};
use sylvia::cw_schema::write_api;
use sylvia::cw_std::Empty;

#[cfg(not(tarpaulin_include))]
fn main() {
write_api! {
crate_name: sylvia::cw_schema,
instantiate: InstantiateMsg,
execute: ContractExecMsg<Empty, Empty>,
query: ContractQueryMsg<Empty, Empty>,
Expand Down
1 change: 0 additions & 1 deletion examples/contracts/cw20-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ mt = ["library", "cw-multi-test", "anyhow"]

[dependencies]
anyhow = { workspace = true, optional = true }
cosmwasm-schema = { workspace = true }
cw-multi-test = { workspace = true, optional = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion examples/contracts/cw20-base/src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use cosmwasm_schema::write_api;
use cw20_base::contract::sv::{ContractExecMsg, ContractQueryMsg, InstantiateMsg};
use sylvia::cw_schema::write_api;
use sylvia::cw_std::Empty;

#[cfg(not(tarpaulin_include))]
fn main() {
write_api! {
crate_name: sylvia::cw_schema,
instantiate: InstantiateMsg,
execute: ContractExecMsg<Empty, Empty>,
query: ContractQueryMsg<Empty, Empty>,
Expand Down
10 changes: 5 additions & 5 deletions examples/contracts/cw20-base/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::error::ContractError;
use crate::responses::{BalanceResponse, Cw20Coin, Cw20ReceiveMsg, TokenInfoResponse};
use crate::validation::{validate_accounts, validate_msg, verify_logo};
use cosmwasm_schema::cw_serde;
use cw2::{ensure_from_older_version, set_contract_version};
use cw20_allowances::responses::AllowanceResponse;
use cw20_marketing::responses::{LogoInfo, MarketingInfoResponse};
use cw20_marketing::Logo;
use cw20_minting::responses::MinterResponse;
use cw_storage_plus::{Item, Map};
use sylvia::cw_schema::cw_serde;
use sylvia::cw_std::{
ensure, Addr, Binary, BlockInfo, DepsMut, Empty, Order, Response, StdError, StdResult, Storage,
Uint128,
Expand All @@ -22,7 +22,7 @@ use sylvia::entry_points;
const CONTRACT_NAME: &str = "crates.io:cw20-base";
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct TokenInfo {
pub name: String,
pub symbol: String,
Expand All @@ -37,22 +37,22 @@ impl TokenInfo {
}
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct MinterData {
pub minter: Addr,
/// cap is how many more tokens can be issued by the minter
pub cap: Option<Uint128>,
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct InstantiateMarketingInfo {
pub project: Option<String>,
pub description: Option<String>,
pub marketing: Option<String>,
pub logo: Option<Logo>,
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct InstantiateMsgData {
pub name: String,
pub symbol: String,
Expand Down
2 changes: 1 addition & 1 deletion examples/contracts/cw20-base/src/multitest/receiver.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use sylvia::cw_std::{Binary, Response, StdError, Uint128};
use sylvia::interface;
use sylvia::types::ExecCtx;
use sylvia::{interface, schemars};

#[interface]
#[sv::custom(msg=sylvia::cw_std::Empty, query=sylvia::cw_std::Empty)]
Expand Down
14 changes: 7 additions & 7 deletions examples/contracts/cw20-base/src/responses.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use cosmwasm_schema::cw_serde;
use std::fmt;
use sylvia::cw_schema::cw_serde;
use sylvia::cw_std::{to_json_binary, Addr, Binary, CosmosMsg, StdResult, Uint128, WasmMsg};

/// Cw20ReceiveMsg should be de/serialized under `Receive()` variant in a ExecuteMsg
#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct Cw20ReceiveMsg {
pub sender: String,
pub amount: Uint128,
Expand All @@ -30,12 +30,12 @@ impl Cw20ReceiveMsg {
}

// This is just a helper to properly serialize the above message
#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
enum ReceiverExecuteMsg {
Receive(Cw20ReceiveMsg),
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct Cw20Coin {
pub address: String,
pub amount: Uint128,
Expand All @@ -53,7 +53,7 @@ impl fmt::Display for Cw20Coin {
}
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct Cw20CoinVerified {
pub address: Addr,
pub amount: Uint128,
Expand All @@ -71,12 +71,12 @@ impl fmt::Display for Cw20CoinVerified {
}
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct BalanceResponse {
pub balance: Uint128,
}

#[cw_serde]
#[cw_serde(crate = "sylvia::cw_schema")]
pub struct TokenInfoResponse {
pub name: String,
pub symbol: String,
Expand Down
1 change: 0 additions & 1 deletion examples/contracts/entry-points-overriding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ mt = ["library", "cw-multi-test", "anyhow"]

[dependencies]
anyhow = { workspace = true, optional = true }
cosmwasm-schema = { workspace = true }
cw-multi-test = { workspace = true, optional = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
Expand Down
Loading
Loading