EXTCODEHASH support in instructions lib

This commit is contained in:
Andrei Maiboroda 2018-07-31 14:49:36 +02:00
parent 2e25d34c11
commit 14b585922b
No known key found for this signature in database
GPG Key ID: 290E6134B4FA2A15
3 changed files with 9 additions and 1 deletions

View File

@ -70,6 +70,7 @@ enum evmc_opcode
OP_EXTCODECOPY = 0x3c,
OP_RETURNDATASIZE = 0x3d,
OP_RETURNDATACOPY = 0x3e,
OP_EXTCODEHASH = 0x3f,
OP_BLOCKHASH = 0x40,
OP_COINBASE = 0x41,

View File

@ -69,7 +69,7 @@ static const char* constantinople_names[256] = {
/* 0x3c */ "EXTCODECOPY",
/* 0x3d */ "RETURNDATASIZE",
/* 0x3e */ "RETURNDATACOPY",
/* 0x3f */ NULL,
/* 0x3f */ "EXTCODEHASH",
/* 0x40 */ "BLOCKHASH",
/* 0x41 */ "COINBASE",
/* 0x42 */ "TIMESTAMP",

View File

@ -101,6 +101,13 @@ TEST(instructions, constantinople_hard_fork)
EXPECT_EQ(b[OP_CREATE2].gas_cost, -1);
EXPECT_EQ(cn[OP_CREATE2], std::string{"CREATE2"});
EXPECT_EQ(bn[OP_CREATE2], nullptr);
EXPECT_EQ(c[OP_EXTCODEHASH].gas_cost, 400);
EXPECT_EQ(c[OP_EXTCODEHASH].num_stack_arguments, 1);
EXPECT_EQ(c[OP_EXTCODEHASH].num_stack_returned_items, 1);
EXPECT_EQ(b[OP_EXTCODEHASH].gas_cost, -1);
EXPECT_EQ(cn[OP_EXTCODEHASH], std::string{"EXTCODEHASH"});
EXPECT_EQ(bn[OP_EXTCODEHASH], nullptr);
}