Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix is_replay_protected #132

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading