Skip to content

Commit

Permalink
Merge pull request #670 from ethereum/mocked_host_storage_value
Browse files Browse the repository at this point in the history
mocked_host: Improve StorageValue constructors
  • Loading branch information
chfast authored Aug 24, 2022
2 parents 4ef91ad + 07ce057 commit 184b08a
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions include/evmc/mocked_host.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,22 @@ struct StorageValue
bytes32 original;

/// Is the storage key cold or warm.
evmc_access_status access_status{EVMC_ACCESS_COLD};
evmc_access_status access_status = EVMC_ACCESS_COLD;

/// Default constructor.
StorageValue() noexcept = default;

/// Constructor.
StorageValue(const bytes32& _value) noexcept // NOLINT
: current{_value}, original{_value}
{}

/// Constructor with original value.
StorageValue(const bytes32& _value, const bytes32& _original) noexcept
: current{_value}, original{_original}
/// Constructor sets the current and original to the same value. Optional access status.
StorageValue(const bytes32& _value, // NOLINT(hicpp-explicit-conversions)
evmc_access_status _access_status = EVMC_ACCESS_COLD) noexcept
: current{_value}, original{_value}, access_status{_access_status}
{}

/// Constructor with initial access status.
StorageValue(const bytes32& _value, evmc_access_status _access_status) noexcept
: current{_value}, original{_value}, access_status{_access_status}
/// Constructor with original value and optional access status
StorageValue(const bytes32& _value,
const bytes32& _original,
evmc_access_status _access_status = EVMC_ACCESS_COLD) noexcept
: current{_value}, original{_original}, access_status{_access_status}
{}
};

Expand Down

0 comments on commit 184b08a

Please sign in to comment.