diff --git a/core/src/env/srml/srml_only/impls.rs b/core/src/env/srml/srml_only/impls.rs index 4c765b452ef..683a493967f 100644 --- a/core/src/env/srml/srml_only/impls.rs +++ b/core/src/env/srml/srml_only/impls.rs @@ -113,17 +113,7 @@ where T: EnvTypes, { fn input() -> Vec { - let size = unsafe { sys::ext_input_size() }; - if size == 0 { - Vec::new() - } else { - let mut buffer = Vec::new(); - buffer.resize(size as usize, 0); - unsafe { - sys::ext_input_copy(buffer.as_mut_ptr() as u32, 0, size); - } - buffer - } + read_scratch_buffer() } impl_getters_for_srml_env!( diff --git a/core/src/env/srml/srml_only/sys.rs b/core/src/env/srml/srml_only/sys.rs index e5e9be76123..af3763b0312 100644 --- a/core/src/env/srml/srml_only/sys.rs +++ b/core/src/env/srml/srml_only/sys.rs @@ -82,12 +82,6 @@ extern "C" { /// Copies the contents of the scratch buffer to `dest_ptr`. pub fn ext_scratch_copy(dest_ptr: u32, offset: u32, len: u32); - /// Returns the length of the input buffer. - pub fn ext_input_size() -> u32; - - /// Copies the contents of the input buffer to `dest_ptr`. - pub fn ext_input_copy(dest_ptr: u32, offset: u32, len: u32); - /// Immediately returns contract execution to the caller /// with the provided data at `data_ptr`. pub fn ext_return(data_ptr: u32, data_len: u32) -> !; diff --git a/examples/lang/erc20/src/lib.rs b/examples/lang/erc20/src/lib.rs index 0d53f0acecd..7538bf39eb4 100644 --- a/examples/lang/erc20/src/lib.rs +++ b/examples/lang/erc20/src/lib.rs @@ -151,7 +151,7 @@ contract! { mod tests { use super::*; use ink_core::env; - type Types = ink_types_node_runtime::NodeRuntimeTypes; + type Types = ink_core::env::DefaultSrmlTypes; #[test] fn deployment_works() {