diff --git a/test/unittests/instructions_test.cpp b/test/unittests/instructions_test.cpp index a4216be4c..d665c4872 100644 --- a/test/unittests/instructions_test.cpp +++ b/test/unittests/instructions_test.cpp @@ -382,6 +382,10 @@ TEST(instructions, shanghai_hard_fork) { if (op == OP_PUSH0) continue; + if (op == OP_DUPN) + continue; + if (op == OP_SWAPN) + continue; EXPECT_EQ(s[op], p[op]) << op; EXPECT_STREQ(sn[op], pn[op]) << op; } @@ -393,4 +397,20 @@ TEST(instructions, shanghai_hard_fork) EXPECT_EQ(p[OP_PUSH0].gas_cost, 0); EXPECT_EQ(sn[OP_PUSH0], std::string{"PUSH0"}); EXPECT_TRUE(pn[OP_PUSH0] == nullptr); + + // EIP-663: DUPN instruction + EXPECT_EQ(s[OP_DUPN].gas_cost, 3); + EXPECT_EQ(s[OP_DUPN].stack_height_required, 0); + EXPECT_EQ(s[OP_DUPN].stack_height_change, 1); + EXPECT_EQ(p[OP_DUPN].gas_cost, 0); + EXPECT_EQ(sn[OP_DUPN], std::string{"DUPN"}); + EXPECT_TRUE(pn[OP_DUPN] == nullptr); + + // EIP-663: SWAPN instruction + EXPECT_EQ(s[OP_SWAPN].gas_cost, 3); + EXPECT_EQ(s[OP_SWAPN].stack_height_required, 0); + EXPECT_EQ(s[OP_SWAPN].stack_height_change, 0); + EXPECT_EQ(p[OP_SWAPN].gas_cost, 0); + EXPECT_EQ(sn[OP_SWAPN], std::string{"SWAPN"}); + EXPECT_TRUE(pn[OP_SWAPN] == nullptr); }