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

Floaty contract cleanup #1893

Merged
merged 2 commits into from
Sep 29, 2023
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
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
Loading