LCOV - differential code coverage report
Current view: top level - test/state - mpt_hash.hpp (source / functions) Coverage Total Hit UBC CBC
Current: DIFF_COVERAGE Lines: 100.0 % 2 2 2
Current Date: 2024-03-20 16:29:22 Functions: 50.0 % 6 3 3 3
Baseline: coverage_BASE.lcov
Baseline Date: 2024-03-20 14:19:08

           TLA  Line data    Source code
       1                 : // evmone: Fast Ethereum Virtual Machine implementation
       2                 : // Copyright 2022 The evmone Authors.
       3                 : // SPDX-License-Identifier: Apache-2.0
       4                 : #pragma once
       5                 : 
       6                 : #include "hash_utils.hpp"
       7                 : #include <span>
       8                 : #include <unordered_map>
       9                 : 
      10                 : namespace evmone::state
      11                 : {
      12                 : struct Account;
      13                 : 
      14                 : /// Computes Merkle Patricia Trie root hash for the given collection of state accounts.
      15                 : hash256 mpt_hash(const std::unordered_map<address, Account>& accounts);
      16                 : 
      17                 : /// Computes Merkle Patricia Trie root hash for the given list of structures.
      18                 : template <typename T>
      19                 : hash256 mpt_hash(std::span<const T> list);
      20                 : 
      21                 : /// A helper to automatically convert collections (e.g. vector, array) to span.
      22                 : template <typename T>
      23 CBC         159 : inline hash256 mpt_hash(const T& list)
      24                 :     requires std::is_convertible_v<T, std::span<const typename T::value_type>>
      25                 : {
      26             159 :     return mpt_hash(std::span<const typename T::value_type>{list});
      27                 : }
      28                 : 
      29                 : }  // namespace evmone::state
        

Generated by: LCOV version 2.0-1