Skip to content
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
12 changes: 1 addition & 11 deletions core/src/env/srml/srml_only/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,7 @@ where
T: EnvTypes,
{
fn input() -> Vec<u8> {
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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the simplicity of this change. 👍

}

impl_getters_for_srml_env!(
Expand Down
6 changes: 0 additions & 6 deletions core/src/env/srml/srml_only/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> !;
Expand Down
2 changes: 1 addition & 1 deletion examples/lang/erc20/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down