Skip to content

Commit

Permalink
Add test for failed rbf when same priority fee specified
Browse files Browse the repository at this point in the history
  • Loading branch information
sieniven committed Oct 2, 2023
1 parent 1a99ad2 commit a16cc36
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions test/functional/feature_evm_eip1559_fees.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ def replace_by_fee(self):
)
assert_equal(len(self.nodes[0].getrawmempool()), 1)

# send higher max fee tx but lower priority fee tx, RBF should not happen
priority_fee3 = self.node.w3.to_wei("25", "gwei")
# send same priority fees, RBF should not happen
priority_fee3 = self.node.w3.to_wei("30", "gwei")
max_fee3 = self.node.w3.to_wei("100", "gwei")
tx = self.contract.functions.store(10).build_transaction(
{
Expand All @@ -359,6 +359,29 @@ def replace_by_fee(self):
self.node.w3.eth.send_raw_transaction,
signed.rawTransaction,
)

# send higher max fee tx but lower priority fee tx, RBF should not happen
priority_fee4 = self.node.w3.to_wei("25", "gwei")
max_fee4 = self.node.w3.to_wei("100", "gwei")
tx = self.contract.functions.store(10).build_transaction(
{
"chainId": self.node.w3.eth.chain_id,
"nonce": self.node.w3.eth.get_transaction_count(
self.evm_key_pair.address
),
"maxPriorityFeePerGas": priority_fee4,
"maxFeePerGas": max_fee4,
}
)
signed = self.node.w3.eth.account.sign_transaction(
tx, self.evm_key_pair.privkey
)
assert_raises_web3_error(
-32001,
"evm-low-fee",
self.node.w3.eth.send_raw_transaction,
signed.rawTransaction,
)
assert_equal(len(self.nodes[0].getrawmempool()), 1)

self.nodes[0].generate(1)
Expand Down

0 comments on commit a16cc36

Please sign in to comment.