Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
bvrooman committed Feb 6, 2024
1 parent c2a7644 commit f9fe1cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
12 changes: 5 additions & 7 deletions fuel-tx/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use fuel_types::{
};

use alloc::vec::Vec;
use core::{
iter,
ops::Deref,
};
use core::iter;

/// The target size of Merkle tree leaves in bytes. Contract code will will be divided
/// into chunks of this size and pushed to the Merkle tree.
Expand Down Expand Up @@ -106,9 +103,9 @@ impl Contract {
I: Iterator<Item = &'a StorageSlot>,
{
let storage_slots = storage_slots
.map(|slot| (MerkleTreeKey::new(*slot.key().deref()), slot.value()));
.map(|slot| (*slot.key(), slot.value()))
.map(|(key, data)| (MerkleTreeKey::new(key), data));
let root = SparseMerkleTree::root_from_set(storage_slots);

root.into()
}

Expand Down Expand Up @@ -182,6 +179,7 @@ impl TryFrom<&Transaction> for Contract {
#[cfg(test)]
mod tests {
use super::*;
use crate::StorageData;
use fuel_types::bytes::WORD_SIZE;
use itertools::Itertools;
use quickcheck_macros::quickcheck;
Expand Down Expand Up @@ -232,7 +230,7 @@ mod tests {
#[rstest]
fn state_root_snapshot(
#[values(Vec::new(), vec![ (Bytes32::new([1u8; 32]), vec![1u8; 32]) ] )]
state_slot_bytes: Vec<(Bytes32, Vec<u8>)>,
state_slot_bytes: Vec<(Bytes32, StorageData)>,
) {
let slots: Vec<StorageSlot> =
state_slot_bytes.iter().map(Into::into).collect_vec();
Expand Down
1 change: 0 additions & 1 deletion fuel-vm/src/interpreter/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ use fuel_tx::{
ContractIdExt,
DependentCost,
Receipt,
StorageData,
};
use fuel_types::{
bytes,
Expand Down

0 comments on commit f9fe1cf

Please sign in to comment.