From 788eb028255dc31aa108ac300dca52ad064fabf0 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Fri, 12 Mar 2021 09:12:52 +0100 Subject: [PATCH] EVMHost: Use std::map for storage so that slots are stored in some order. --- test/EVMHost.cpp | 2 +- test/EVMHost.h | 2 +- test/evmc/mocked_host.hpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/EVMHost.cpp b/test/EVMHost.cpp index 3d0fd25d1..08c827f6c 100644 --- a/test/EVMHost.cpp +++ b/test/EVMHost.cpp @@ -37,7 +37,7 @@ using namespace solidity::util; using namespace solidity::test; using namespace evmc::literals; -using StorageMap = std::unordered_map; +using StorageMap = std::map; evmc::VM& EVMHost::getVM(string const& _path) { diff --git a/test/EVMHost.h b/test/EVMHost.h index a39c3fb98..c258c6dd0 100644 --- a/test/EVMHost.h +++ b/test/EVMHost.h @@ -63,7 +63,7 @@ public: } /// @returns contents of storage at @param _addr. - std::unordered_map const& get_address_storage(evmc::address const& _addr); + std::map const& get_address_storage(evmc::address const& _addr); bool account_exists(evmc::address const& _addr) const noexcept final { diff --git a/test/evmc/mocked_host.hpp b/test/evmc/mocked_host.hpp index c36bd3a04..19ba27657 100644 --- a/test/evmc/mocked_host.hpp +++ b/test/evmc/mocked_host.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -48,7 +49,7 @@ struct MockedAccount uint256be balance; /// The account storage map. - std::unordered_map storage; + std::map storage; /// Helper method for setting balance by numeric type. void set_balance(uint64_t x) noexcept