Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
MedovTimur committed Dec 9, 2024
1 parent 2741727 commit 17c7f62
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions extended-vft/tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use std::mem;
use extended_vft_client::{
traits::{ExtendedVftFactory, Vft},
ExtendedVftFactory as Factory, Vft as VftClient,
};
use sails_rs::calls::*;
use sails_rs::collections::HashMap;
use sails_rs::{ActorId, U256};
use sails_rs::gtest::{calls::*, System};
use sails_rs::{ActorId, U256};
use std::mem;

pub const ADMIN_ID: u64 = 10;
pub const USER_ID: [u64; 2] = [11, 12];
@@ -264,7 +264,6 @@ async fn test_memory_allocation() {
let mut user_id: u64 = 11;
let mut map: HashMap<ActorId, U256> = HashMap::with_capacity(u16::MAX as usize);
loop {

map.insert(user_id.into(), 10.into());
client
.mint(user_id.into(), 10.into())
@@ -293,14 +292,11 @@ async fn test_memory_allocation() {
}
}
user_id += 1;

}


}

fn hash_map_memory_usage<K, V>(map: &HashMap<K, V>) -> usize {
let num_buckets = map.capacity();
let num_buckets = map.capacity();
let static_size = mem::size_of::<HashMap<K, V>>();
let bucket_size = mem::size_of::<(K, V)>() * num_buckets;
static_size + bucket_size

0 comments on commit 17c7f62

Please sign in to comment.