mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
EVMHost: Use std::map for storage so that slots are stored in some order.
This commit is contained in:
parent
0e22d0bd40
commit
788eb02825
@ -37,7 +37,7 @@ using namespace solidity::util;
|
||||
using namespace solidity::test;
|
||||
using namespace evmc::literals;
|
||||
|
||||
using StorageMap = std::unordered_map<evmc::bytes32, evmc::storage_value>;
|
||||
using StorageMap = std::map<evmc::bytes32, evmc::storage_value>;
|
||||
|
||||
evmc::VM& EVMHost::getVM(string const& _path)
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
}
|
||||
|
||||
/// @returns contents of storage at @param _addr.
|
||||
std::unordered_map<evmc::bytes32, evmc::storage_value> const& get_address_storage(evmc::address const& _addr);
|
||||
std::map<evmc::bytes32, evmc::storage_value> const& get_address_storage(evmc::address const& _addr);
|
||||
|
||||
bool account_exists(evmc::address const& _addr) const noexcept final
|
||||
{
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <evmc/evmc.hpp>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
@ -48,7 +49,7 @@ struct MockedAccount
|
||||
uint256be balance;
|
||||
|
||||
/// The account storage map.
|
||||
std::unordered_map<bytes32, storage_value> storage;
|
||||
std::map<bytes32, storage_value> storage;
|
||||
|
||||
/// Helper method for setting balance by numeric type.
|
||||
void set_balance(uint64_t x) noexcept
|
||||
|
Loading…
Reference in New Issue
Block a user