diff --git a/test/state/mpt.cpp b/test/state/mpt.cpp index df2b5806ec..57f9c4a81b 100644 --- a/test/state/mpt.cpp +++ b/test/state/mpt.cpp @@ -123,24 +123,6 @@ class MPTNode [[nodiscard]] hash256 hash() const; }; -MPT::MPT() noexcept = default; -MPT::~MPT() noexcept = default; - -void MPT::insert(bytes_view key, bytes&& value) -{ - if (m_root == nullptr) - m_root = std::make_unique(MPTNode::leaf(Path{key}, std::move(value))); - else - m_root->insert(Path{key}, std::move(value)); -} - -[[nodiscard]] hash256 MPT::hash() const -{ - if (m_root == nullptr) - return emptyMPTHash; - return m_root->hash(); -} - void MPTNode::insert(const Path& path, bytes&& value) // NOLINT(misc-no-recursion) { switch (m_kind) @@ -282,4 +264,23 @@ hash256 MPTNode::hash() const // NOLINT(misc-no-recursion) return r; } + +MPT::MPT() noexcept = default; +MPT::~MPT() noexcept = default; + +void MPT::insert(bytes_view key, bytes&& value) +{ + if (m_root == nullptr) + m_root = std::make_unique(MPTNode::leaf(Path{key}, std::move(value))); + else + m_root->insert(Path{key}, std::move(value)); +} + +[[nodiscard]] hash256 MPT::hash() const +{ + if (m_root == nullptr) + return emptyMPTHash; + return m_root->hash(); +} + } // namespace evmone::state