Skip to content

Commit

Permalink
feat: migrate custom snip20 for testing into here
Browse files Browse the repository at this point in the history
  • Loading branch information
hoomp3 committed Feb 2, 2024
1 parent 2bff8e6 commit 314e10c
Show file tree
Hide file tree
Showing 23 changed files with 10,732 additions and 17 deletions.
21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ members = [
"contracts/siennaswap_reserves_oracle",
"contracts/siennaswap_spot_oracle",
"contracts/testnet_snip20_faucet",
"contracts/snip20",
"contracts/staking_derivatives/*",
]

[workspace.dependencies]
cosmwasm-schema = "1.2.5"
cosmwasm-std = { package = "secret-cosmwasm-std", version = "1.1.11" }
schemars = "0.8.9"
serde = { version = "1.0.103", default-features = false, features = [
"derive",
"alloc",
] }
cosmwasm-storage = { package = "secret-cosmwasm-storage", version = "1.1.11" }
cosmwasm-schema = "1.2.5"

base64 = "0.21.0"
borsh = "0.10.3"

rand = { version = "0.8.5", default-features = false }
schemars = "0.8.12"
serde = { version = "1.0.158", default-features = false, features = ["derive", "alloc"] }

strum = { version = "0.24", features = ["derive"] }
thiserror = "1.0"
borsh = "0.10.3"
paste = "1.0"
derive-from-ext = "0.2"

Expand All @@ -41,9 +45,6 @@ btr-macros = { git = "https://github.com/securesecrets/shade-plus" }
secret-storage-plus = { git = "https://github.com/securesecrets/shade-plus" }
secret-borsh-storage = { git = "https://github.com/securesecrets/shade-plus" }

# snip20 = { package = "snip20-reference-impl", git = "https://github.com/securesecrets/snip20-reference-impl", branch = "shade-plus", features = ["library"] }
snip20 = { package = "snip20-reference-impl", features = ["library"], path = "../snip20-reference-impl" }

anyhow = "1.0.71"
rstest = "0.15.0"

Expand Down
2 changes: 1 addition & 1 deletion contracts/shadeswap_spot_oracle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ default = []
[dependencies]
cosmwasm-std = { workspace = true }
shade-oracles = { path = "../../packages/shade_oracles", features = ["dex"] }
snip20 = { workspace = true }
snip20 = { path = "../snip20", package = "snip20-reference-impl", features = ["library"] }
2 changes: 1 addition & 1 deletion contracts/siennaswap_reserves_oracle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ default = []
[dependencies]
cosmwasm-std = { workspace = true }
shade-oracles = { path = "../../packages/shade_oracles", features = ["dex"] }
snip20 = { workspace = true }
snip20 = { path = "../snip20", package = "snip20-reference-impl", features = ["library"] }
2 changes: 1 addition & 1 deletion contracts/siennaswap_spot_oracle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ default = []
[dependencies]
cosmwasm-std = { workspace = true }
shade-oracles = { path = "../../packages/shade_oracles", features = ["dex"] }
snip20 = { workspace = true }
snip20 = { path = "../snip20", package = "snip20-reference-impl", features = ["library"] }
54 changes: 54 additions & 0 deletions contracts/snip20/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[package]
name = "snip20-reference-impl"
version = "1.0.0"
authors = ["Itzik <itzik@keytango.io>"]
edition = "2021"
exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib", "rlib"]

[profile.release]
opt-level = 3
debug = false
rpath = false
lto = true
debug-assertions = false
codegen-units = 1
panic = 'abort'
incremental = false
overflow-checks = true

[features]
# for quicker tests, cargo test --lib
# for more explicit tests, cargo test --features=backtraces
#default = ["debug-print"]
backtraces = ["cosmwasm-std/backtraces"]
library = []

# debug-print = ["cosmwasm-std/debug-print"]
[dependencies]
cosmwasm-std = { workspace = true }
cosmwasm-storage = { workspace = true }
cosmwasm-schema = { workspace = true }

shade-toolkit = { workspace = true }

secret-toolkit = { git = "https://github.com/securesecrets/secret-toolkit", features = [
"permit",
"viewing-key",
] }
secret-toolkit-crypto = { git = "https://github.com/securesecrets/secret-toolkit", features = [
"rand",
"hash",
] }

rand = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
base64 = { workspace = true }
21 changes: 21 additions & 0 deletions contracts/snip20/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use std::env::current_dir;
use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, remove_schemas, schema_for};

use snip20_reference_impl::msg::{
ExecuteAnswer, ExecuteMsg, InstantiateMsg, QueryAnswer, QueryMsg,
};

fn main() {
let mut out_dir = current_dir().unwrap();
out_dir.push("schema");
create_dir_all(&out_dir).unwrap();
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema(&schema_for!(ExecuteMsg), &out_dir);
export_schema(&schema_for!(ExecuteAnswer), &out_dir);
export_schema(&schema_for!(QueryMsg), &out_dir);
export_schema(&schema_for!(QueryAnswer), &out_dir);
}
Loading

0 comments on commit 314e10c

Please sign in to comment.