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

Final integration #12

Merged
merged 11 commits into from
Aug 5, 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
11 changes: 0 additions & 11 deletions .cargo/config

This file was deleted.

1 change: 1 addition & 0 deletions .cargo/config
12 changes: 12 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[alias]
# Temporarily removed the backtraces feature from the unit-test run due to compilation errors in
# the cosmwasm-std package:
# cosmwasm-std = { git = "https://github.com/scrtlabs/cosmwasm", branch = "secret" }
# unit-test = "test --lib --features backtraces"
unit-test = "test --lib"
integration-test = "test --test integration"
schema = "run --example schema"

[features]
gas_tracking = []
gas_evaporation = []
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ overflow-checks = true
#default = ["debug-print"]
backtraces = ["cosmwasm-std/backtraces"]
gas_tracking = []
gas_evaporation = []

# debug-print = ["cosmwasm-std/debug-print"]
[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _compile:
.PHONY: compile-integration _compile-integration
compile-integration: _compile-integration contract.wasm.gz
_compile-integration:
DWB_CAPACITY=8 BTBE_CAPACITY=8 RUSTFLAGS='-C link-arg=-s' cargo build --features "gas_tracking" --release --target wasm32-unknown-unknown
DWB_CAPACITY=64 BTBE_CAPACITY=64 RUSTFLAGS='-C link-arg=-s' cargo build --features "gas_tracking" --release --target wasm32-unknown-unknown
@# The following line is not necessary, may work only on linux (extra size optimization)
wasm-opt -Oz ./target/wasm32-unknown-unknown/release/*.wasm --all-features -o ./contract.wasm

Expand Down
10 changes: 5 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ use std::path::Path;
fn main() {
// config parameters
let dwb_capacity = env::var("DWB_CAPACITY").unwrap_or_else(|_| "64".to_string());
let btbe_capacity = env::var("BTBE_CAPACITY").unwrap_or_else(|_| "128".to_string());
let btbe_capacity = env::var("BTBE_CAPACITY").unwrap_or_else(|_| "64".to_string());

// path to destination config.rs file
let out_dir = env::var("OUT_DIR").expect("Missing OUT_DIR");
let out_dir = env::var("OUT_DIR").expect("Missing OUT_DIR");
let dest_path = Path::new(&out_dir).join("config.rs");

// write constants
let mut file = File::create(&dest_path).expect("Failed to write to config.rs");
write!(file, "pub const DWB_CAPACITY: u16 = {};\n", dwb_capacity).unwrap();
write!(file, "pub const BTBE_CAPACITY: u16 = {};\n", btbe_capacity).unwrap();

// monitor
println!("cargo:rerun-if-env-changed=DWB_CAPACITY");
println!("cargo:rerun-if-env-changed=BTBE_CAPACITY");
// monitor
println!("cargo:rerun-if-env-changed=DWB_CAPACITY");
println!("cargo:rerun-if-env-changed=BTBE_CAPACITY");
}
1 change: 0 additions & 1 deletion src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ pub struct BurnFromAction {
pub amount: Uint128,
pub memo: Option<String>,
}

Loading