Skip to content

Commit

Permalink
Rename EVMC_LATEST_REVISION to EVMC_MAX_REVISION
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jan 18, 2019
1 parent f27aa78 commit 5f854c0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* EVMC: Ethereum Client-VM Connector API.
* Copyright 2018 The EVMC Authors.
* Licensed under the Apache License, Version 2.0. See the LICENSE file.
* Copyright 2019 The EVMC Authors.
* Licensed under the Apache License, Version 2.0.
*/

/** This example shows how to use evmc::instructions library from evmc CMake package. */
Expand All @@ -9,6 +9,5 @@

int main()
{
return evmc_get_instruction_metrics_table(EVMC_LATEST_REVISION)[OP_STOP]
.num_stack_returned_items;
return evmc_get_instruction_metrics_table(EVMC_BYZANTIUM)[OP_STOP].num_stack_returned_items;
}
7 changes: 4 additions & 3 deletions include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* EVMC: Ethereum Client-VM Connector API
*
* @copyright
* Copyright 2018 The EVMC Authors.
* Licensed under the Apache License, Version 2.0. See the LICENSE file.
* Copyright 2019 The EVMC Authors.
* Licensed under the Apache License, Version 2.0.
*
* @defgroup EVMC EVMC
* @{
Expand Down Expand Up @@ -708,7 +708,8 @@ enum evmc_revision
EVMC_CONSTANTINOPLE = 5,
EVMC_ISTANBUL = 6,

EVMC_LATEST_REVISION = EVMC_ISTANBUL /**< This is the maximum revision number supported. */
/** The maximum EVM revision supported. */
EVMC_MAX_REVISION = EVMC_ISTANBUL
};


Expand Down
2 changes: 1 addition & 1 deletion test/unittests/test_instructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ TEST(instructions, constantinople_hard_fork)

TEST(instructions, name_gas_cost_equivalence)
{
for (auto rev = EVMC_FRONTIER; rev <= EVMC_LATEST_REVISION;
for (auto rev = EVMC_FRONTIER; rev <= EVMC_MAX_REVISION;
rev = static_cast<evmc_revision>(rev + 1))
{
const auto names = evmc_get_instruction_names_table(rev);
Expand Down
2 changes: 1 addition & 1 deletion test/vmtester/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TEST_F(evmc_vm_test, execute)
std::array<uint8_t, 2> code = {{0xfe, 0x00}};

evmc_result result =
vm->execute(vm, context, EVMC_LATEST_REVISION, &msg, code.data(), code.size());
vm->execute(vm, context, EVMC_MAX_REVISION, &msg, code.data(), code.size());

// Validate some constraints
if (result.status_code != EVMC_SUCCESS && result.status_code != EVMC_REVERT)
Expand Down

0 comments on commit 5f854c0

Please sign in to comment.