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
2 changes: 1 addition & 1 deletion core/src/env/srml/srml_only/impls.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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