Skip to content

Commit

Permalink
Simplify BMT push error (#959)
Browse files Browse the repository at this point in the history
Follow up to FuelLabs/fuel-vm#328.

Now that `push` returns `StorageError` rather than
`MerkleTree<StorageError>` we no longer need to map the error to
`Other`.
  • Loading branch information
Brandon Vrooman authored Jan 31, 2023
1 parent 3d33fb1 commit d761d2b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/fuel-core/src/database/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ impl StorageMutate<FuelBlocks> for Database {
MerkleTree::load(storage, prev_metadata.version)
.map_err(|err| StorageError::Other(err.into()))?;
let data = key.as_slice();
tree.push(data)
.map_err(|err| StorageError::Other(err.into()))?;
tree.push(data)?;

// Generate new metadata for the updated tree
let version = tree.leaves_count();
Expand Down

0 comments on commit d761d2b

Please sign in to comment.