Skip to content

Commit

Permalink
feat: Cast deps to empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jawoznia committed Aug 23, 2023
1 parent 5e17605 commit 1b931ca
Show file tree
Hide file tree
Showing 17 changed files with 141 additions and 223 deletions.
44 changes: 13 additions & 31 deletions Cargo.lock

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

44 changes: 13 additions & 31 deletions examples/Cargo.lock

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

2 changes: 1 addition & 1 deletion examples/contracts/cw1-subkeys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tests = ["library", "cw-multi-test", "anyhow"]
[dependencies]
anyhow = { version = "1.0.68", optional = true }
cosmwasm-schema = "1.2"
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cw-multi-test = { version = "0.16.2", optional = true }
cw-storage-plus = "1.0"
cw-utils = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/contracts/cw1-whitelist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tests = ["library", "cw-multi-test", "anyhow"]
mt = ["sylvia/mt", "library"]

[dependencies]
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cosmwasm-schema = "1.2"
serde = { version = "1.0", default-features = false, features = ["derive"] }
sylvia = { path = "../../../sylvia" }
Expand Down
4 changes: 2 additions & 2 deletions examples/contracts/cw20-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tests = ["library", "cw-multi-test", "anyhow"]
[dependencies]
anyhow = { version = "1.0", optional = true }
cosmwasm-schema = "1.2"
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cw-multi-test = { version = "0.16", optional = true }
cw-storage-plus = "1.0"
cw-utils = "1.0"
Expand All @@ -39,7 +39,7 @@ cw-multi-test = "0.16"
cw-utils = "1.0"
sylvia = { path = "../../../sylvia", features = ["mt"] }
cw20-allowances = { path = "../../interfaces/cw20-allowances", features = [
"mt",
"mt",
] }
cw20-marketing = { path = "../../interfaces/cw20-marketing", features = ["mt"] }
cw20-minting = { path = "../../interfaces/cw20-minting", features = ["mt"] }
2 changes: 1 addition & 1 deletion examples/contracts/entry-points-overriding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tests = ["library", "cw-multi-test", "anyhow"]
[dependencies]
anyhow = { version = "1.0", optional = true }
cosmwasm-schema = "1.2"
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cw-multi-test = { version = "0.16", optional = true }
cw-storage-plus = "1.0"
cw-utils = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/interfaces/cw1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ homepage = "https://cosmwasm.com"
mt = ["sylvia/mt"]

[dependencies]
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cosmwasm-schema = "1.2"
serde = { version = "1.0", default-features = false, features = ["derive"] }
sylvia = { path = "../../../sylvia" }
Expand Down
2 changes: 1 addition & 1 deletion examples/interfaces/cw20-allowances/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ homepage = "https://cosmwasm.com"
mt = ["sylvia/mt"]

[dependencies]
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cosmwasm-schema = "1.2"
serde = { version = "1.0", default-features = false, features = ["derive"] }
sylvia = { path = "../../../sylvia" }
Expand Down
2 changes: 1 addition & 1 deletion examples/interfaces/cw20-marketing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ homepage = "https://cosmwasm.com"
mt = ["sylvia/mt"]

[dependencies]
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cosmwasm-schema = "1.2"
serde = { version = "1.0", default-features = false, features = ["derive"] }
sylvia = { path = "../../../sylvia" }
Expand Down
2 changes: 1 addition & 1 deletion examples/interfaces/cw20-minting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ homepage = "https://cosmwasm.com"
mt = ["sylvia/mt"]

[dependencies]
cosmwasm-std = { version = "1.2", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cosmwasm-schema = "1.2"
serde = { version = "1.0", default-features = false, features = ["derive"] }
sylvia = { path = "../../../sylvia" }
Expand Down
2 changes: 1 addition & 1 deletion examples/interfaces/cw4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ homepage = "https://cosmwasm.com"
mt = ["sylvia/mt"]

[dependencies]
cosmwasm-std = { version = "1.2.1", features = ["staking"] }
cosmwasm-std = { version = "1.3", features = ["staking"] }
cosmwasm-schema = "1.2"
serde = { version = "1.0", default-features = false, features = ["derive"] }
sylvia = { path = "../../../sylvia" }
Expand Down
23 changes: 18 additions & 5 deletions sylvia-derive/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,15 +901,28 @@ impl<'a> GlueMessage<'a> {
let ContractMessageAttr {
variant,
has_custom_msg,
has_custom_query,
..
} = interface;

match *has_custom_msg&& msg_ty == &MsgType::Exec
{
true => quote! { #contract_name :: #variant(msg) => Ok( #sylvia ::into_response::IntoResponse::into_response(msg.dispatch(contract, Into::into(ctx))?)?) },
false => quote! { #contract_name :: #variant(msg) => msg.dispatch(contract, Into::into(ctx)) }
}
let ctx = match (msg_ty, has_custom_query) {
(MsgType::Exec, true )=> quote! {
( ctx.0.into_empty(), ctx.1, ctx.2)
},
(MsgType::Query, true )=> quote! {
( ctx.0.into_empty(), ctx.1)
},
_=> quote! { ctx },
};

match (msg_ty, has_custom_msg) {
(MsgType::Exec, true) => quote! {
#contract_name :: #variant(msg) => #sylvia ::into_response::IntoResponse::into_response(msg.dispatch(contract, Into::into( #ctx ))?)
},
_ => quote! {
#contract_name :: #variant(msg) => msg.dispatch(contract, Into::into( #ctx ))
},
}
});

let dispatch_arm = quote! {#contract_name :: #contract (msg) =>msg.dispatch(contract, ctx)};
Expand Down
Loading

0 comments on commit 1b931ca

Please sign in to comment.