Skip to content

Commit

Permalink
Merge pull request #1893 from CosmWasm/fix-scripts
Browse files Browse the repository at this point in the history
Floaty contract cleanup
  • Loading branch information
chipshort authored Sep 29, 2023
2 parents 04604cd + 347c6cb commit b5ea7b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions contracts/floaty/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub fn query(_deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<QueryResponse>
}
}

#[cfg_attr(not(target_arch = "wasm32"), allow(unused_variables))]
fn query_run(instruction: &str, args: Vec<Value>) -> StdResult<Value> {
#[cfg(not(target_arch = "wasm32"))]
panic!();
Expand Down
6 changes: 5 additions & 1 deletion contracts/floaty/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use rand_chacha::rand_core::RngCore;
use crate::floats::{random_f32, random_f64};

/// Not intended for direct usage
#[cfg_attr(not(target_arch = "wasm32"), allow(unused_macros))]
macro_rules! run_instr {
($instr:expr, $input:expr, $input_ty:ty, $return_ty:ty) => {{
let input: $input_ty = $input;
Expand All @@ -23,9 +24,11 @@ macro_rules! run_instr {
ret
}};
}
#[cfg_attr(not(target_arch = "wasm32"), allow(unused_imports))]
pub(crate) use run_instr;

/// Helper to run a single WebAssembly instruction in a type-safe way
#[cfg_attr(not(target_arch = "wasm32"), allow(unused_macros))]
macro_rules! run {
("f32.eq", $input1:expr, $input2:expr) => {
$crate::instructions::run_instr!("f32.eq", $input1, f32, $input2, f32, u32)
Expand Down Expand Up @@ -244,6 +247,7 @@ macro_rules! run {
$crate::instructions::run_instr!("i64.trunc_sat_f64_u", $input, f64, u64)
};
}
#[cfg_attr(not(target_arch = "wasm32"), allow(unused_imports))]
pub(crate) use run;

#[cw_serde]
Expand Down Expand Up @@ -471,7 +475,7 @@ pub fn random_args_for(instr: &str, rng: &mut impl RngCore) -> Vec<Value> {
}
}

pub const FLOAT_INSTRUCTIONS: [&'static str; 70] = [
pub const FLOAT_INSTRUCTIONS: [&str; 70] = [
"f32.eq",
"f32.ne",
"f32.lt",
Expand Down
1 change: 1 addition & 0 deletions devtools/check_contracts_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

GLOBIGNORE="contracts/floaty/"
for contract_dir in contracts/*/; do
(
cd "$contract_dir"
Expand Down
1 change: 1 addition & 0 deletions devtools/check_contracts_medium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

GLOBIGNORE="contracts/floaty/"
for contract_dir in contracts/*/; do
(
cd "$contract_dir"
Expand Down

0 comments on commit b5ea7b5

Please sign in to comment.