From 1a400078004be9c57576311a94bcb5e9b831c7a2 Mon Sep 17 00:00:00 2001 From: Robin Freyler Date: Thu, 15 Aug 2019 13:09:38 +0200 Subject: [PATCH] [core] rename ext_scratch_copy to ext_scratch_read --- core/src/env/srml/srml_only/impls.rs | 2 +- core/src/env/srml/srml_only/sys.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/env/srml/srml_only/impls.rs b/core/src/env/srml/srml_only/impls.rs index 2f82c3f9fba..c33dd60b116 100644 --- a/core/src/env/srml/srml_only/impls.rs +++ b/core/src/env/srml/srml_only/impls.rs @@ -34,7 +34,7 @@ fn read_scratch_buffer() -> Vec { if size > 0 { value.resize(size as usize, 0); unsafe { - sys::ext_scratch_copy(value.as_mut_ptr() as u32, 0, size); + sys::ext_scratch_read(value.as_mut_ptr() as u32, 0, size); } } value diff --git a/core/src/env/srml/srml_only/sys.rs b/core/src/env/srml/srml_only/sys.rs index df4ac4602b8..fd530c6355e 100644 --- a/core/src/env/srml/srml_only/sys.rs +++ b/core/src/env/srml/srml_only/sys.rs @@ -85,8 +85,9 @@ extern "C" { /// Returns the length in bytes of the scratch buffer. pub fn ext_scratch_size() -> u32; - /// Copies the contents of the scratch buffer to `dest_ptr`. - pub fn ext_scratch_copy(dest_ptr: u32, offset: u32, len: u32); + /// Reads the contents of the scratch buffer at the host site starting at `offset` and writes them to the + /// buffer starting at `dst_ptr` with length `len` on the smart contract site. + pub fn ext_scratch_read(dst_ptr: u32, offset: u32, len: u32); /// Immediately returns contract execution to the caller /// with the provided data at `data_ptr`.