Skip to content

Commit

Permalink
Merge pull request #132 from eosnetworkfoundation/kayan_is_replay_pro…
Browse files Browse the repository at this point in the history
…tected

fix is_replay_protected
  • Loading branch information
taokayan authored Mar 18, 2024
2 parents 107438a + 2354941 commit df1c04b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion silkworm/silkrpc/common/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ bool check_tx_fee_less_cap(float cap, const intx::uint256& max_fee_per_gas, uint

bool is_replay_protected(const silkworm::Transaction& txn) {
if (txn.type != TransactionType::kLegacy) {
return false;
return true;
}
intx::uint256 v = txn.v();
if (v != 27 && v != 28 && v != 0 && v != 1) {
Expand Down
4 changes: 2 additions & 2 deletions silkworm/silkrpc/common/util_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ TEST_CASE("check_tx_fee_less_cap returns false", "[silkrpc][common][util]") {
CHECK(check == true);
}

TEST_CASE("is_replay_protected(tx legacy) returns true", "[silkrpc][common][util]") {
TEST_CASE("is_replay_protected(tx non-legacy) returns true", "[silkrpc][common][util]") {
const Transaction txn{
{.type = TransactionType::kAccessList,
.nonce = 0,
Expand All @@ -147,7 +147,7 @@ TEST_CASE("is_replay_protected(tx legacy) returns true", "[silkrpc][common][util
};

auto check = is_replay_protected(txn);
CHECK(check == false);
CHECK(check == true);
}

TEST_CASE("is_replay_protected returns true", "[silkrpc][common][util]") {
Expand Down

0 comments on commit df1c04b

Please sign in to comment.