-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from eosnetworkfoundation/elmato/chain-config-…
…refactor ChainConfig refactor
- Loading branch information
Showing
32 changed files
with
577 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include <silkworm/core/types/block.hpp> | ||
#include <silkworm/core/common/endian.hpp> | ||
|
||
namespace eosevm { | ||
|
||
using NonceType=silkworm::BlockHeader::NonceType; | ||
|
||
inline NonceType version_to_nonce(uint64_t version) { | ||
NonceType nonce; | ||
silkworm::endian::store_big_u64(nonce.data(), version); | ||
return nonce; | ||
} | ||
|
||
inline uint64_t nonce_to_version(const NonceType& nonce) { | ||
// The nonce will be treated as big-endian number for now. | ||
return silkworm::endian::load_big_u64(nonce.data()); | ||
} | ||
|
||
inline evmc_revision version_to_evmc_revision(uint64_t version) { | ||
switch (version) { | ||
case 0: return EVMC_ISTANBUL; | ||
case 1: return EVMC_ISTANBUL; | ||
default: return EVMC_ISTANBUL; | ||
} | ||
} | ||
|
||
} // namespace eosevm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.