Skip to content

Commit

Permalink
tribute contract implementation & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dusan-maksimovic committed Apr 25, 2024
1 parent f951a0f commit e3a7644
Show file tree
Hide file tree
Showing 15 changed files with 1,208 additions and 212 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["contracts/atom_wars"]
members = ["contracts/atom_wars", "contracts/tribute"]

[profile.release]
opt-level = 3
Expand Down
2 changes: 1 addition & 1 deletion contracts/atom_wars/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "counter"
name = "atom-wars"
version = "1.0.0"
authors = ["Udit Gulati"]
edition = "2018"
Expand Down
17 changes: 17 additions & 0 deletions contracts/atom_wars/examples/atom_wars_schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use std::env::current_dir;
use std::fs::create_dir_all;

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

use atom_wars::{ExecuteMsg, InstantiateMsg, 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!(QueryMsg), &out_dir);
}
2 changes: 1 addition & 1 deletion contracts/atom_wars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod state;

pub use msg::{ExecuteMsg, InstantiateMsg};
pub use query::QueryMsg;
pub use state::Constants;
pub use state::{Constants, Proposal, Vote};

#[cfg(test)]
mod testing;
Expand Down
34 changes: 34 additions & 0 deletions contracts/tribute/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "tribute"
version = "1.0.0"
edition = "2018"

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"]

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

[dependencies]
cosmwasm-std = { version = "1.0.0-beta8", features = ["staking"] }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
snafu = { version = "0.6.3" }
thiserror = { version = "1.0.23" }
cw-storage-plus = { version = "0.13.2" }
cosmwasm-schema = { version = "1.0.0-beta8" }
atom-wars = { path = "../atom_wars" }

[dev-dependencies]
cosmwasm-schema = { version = "1.0.0-beta8" }
191 changes: 0 additions & 191 deletions contracts/tribute/contract.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fs::create_dir_all;

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

use counter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use tribute::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
let mut out_dir = current_dir().unwrap();
Expand Down
Loading

0 comments on commit e3a7644

Please sign in to comment.