Offchain testing: Fix reading response (#10294)

This commit is contained in:
Bastian Köcher
2021-11-17 11:35:21 +01:00
committed by GitHub
parent f037651788
commit 506ca48dc8
2 changed files with 33 additions and 1 deletions
@@ -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)
}