Skip to content

Commit

Permalink
Merge 1a40007 into 5c5d17d
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Aug 15, 2019
2 parents 5c5d17d + 1a40007 commit 29f0246
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/env/srml/srml_only/impls.rs
Expand Up @@ -34,7 +34,7 @@ fn read_scratch_buffer() -> Vec<u8> {
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
Expand Down
5 changes: 3 additions & 2 deletions core/src/env/srml/srml_only/sys.rs
Expand Up @@ -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`.
Expand Down

0 comments on commit 29f0246

Please sign in to comment.