Skip to content

Commit

Permalink
fix memory alocation test
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszaaa committed Aug 26, 2021
1 parent 6ef2484 commit 5d2d274
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test-utils/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,14 @@ mod tests {

client.import(BlockOrigin::Own, block).unwrap();

let (new_block_id, block) = {
let builder = client.new_block_at(&new_block_id, Default::default(), false).unwrap();
let block = builder.build(Default::default()).unwrap().block;
let hash = block.header.hash();
(BlockId::Hash(hash), block)
};
client.import(BlockOrigin::Own, block).unwrap();

// Allocation of 1024k while having ~2048k should succeed.
let ret = client.runtime_api().vec_with_capacity(&new_block_id, 1048576);
assert!(ret.is_ok());
Expand Down

0 comments on commit 5d2d274

Please sign in to comment.