Offchain testing: Fix reading response (#10294)

This commit is contained in:
Bastian Köcher authored and GitHub committed 2021-11-17 11:35:21 +01:00
1 parent f037651788
commit 506ca48dc8
2 files changed
+33 -1

No files matched your search

@@ -341,7 +341,7 @@ impl offchain::Externalities for TestOffchainExt {
Ok(0)
} else {
let read = std::cmp::min(buffer.len(), response[req.read..].len());
buffer[0..read].copy_from_slice(&response[req.read..read]);
buffer[0..read].copy_from_slice(&response[req.read..req.read + read]);
req.read += read;
Ok(read)
}