From f0dbcf540102a7a1244c4a94be6c24eba73ca68a Mon Sep 17 00:00:00 2001 From: Sergei Pepyakin Date: Mon, 21 Jan 2019 14:04:58 +0100 Subject: [PATCH] Verify that contracts cannot use float operations (#1504) --- substrate/srml/contract/src/wasm/prepare.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/substrate/srml/contract/src/wasm/prepare.rs b/substrate/srml/contract/src/wasm/prepare.rs index 622e48e686..ae09ad87af 100644 --- a/substrate/srml/contract/src/wasm/prepare.rs +++ b/substrate/srml/contract/src/wasm/prepare.rs @@ -342,6 +342,22 @@ mod tests { }; } + prepare_test!(no_floats, + r#" + (module + (func (export "call") + (drop + (f32.add + (f32.const 0) + (f32.const 1) + ) + ) + ) + (func (export "deploy")) + )"#, + Err("gas instrumentation failed") + ); + mod memories { use super::*;