Skip to content

Commit

Permalink
Add test for balance prevalidation check
Browse files Browse the repository at this point in the history
  • Loading branch information
sieniven committed Sep 5, 2023
1 parent 66173a4 commit 5755f7a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/functional/feature_evm_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_max_gas_price(self):
# Test insufficient balance due to high gas fees
assert_raises_rpc_error(
-32001,
"evm tx failed to validate insufficient balance to pay fees",
"evm tx failed to validate prepay fee value overflow",
self.nodes[0].eth_sendTransaction,
{
"from": self.ethAddress,
Expand Down Expand Up @@ -254,11 +254,7 @@ def test_fee_deduction_empty_balance(self):
emptyAddress = self.nodes[0].getnewaddress("", "erc55")
balance = self.nodes[0].eth_getBalance(emptyAddress, "latest")
assert_equal(int(balance[2:], 16), 000000000000000000000)

assert_raises_rpc_error(
-32001,
"evm tx failed to validate insufficient balance to pay fees",
self.nodes[0].eth_sendTransaction,
self.nodes[0].eth_sendTransaction(
{
"from": emptyAddress,
"to": self.toAddress,
Expand All @@ -267,6 +263,10 @@ def test_fee_deduction_empty_balance(self):
"gasPrice": "0x2540BE400", # 10_000_000_000
},
)
self.nodes[0].generate(1)
block = self.nodes[0].getblock(self.nodes[0].getbestblockhash())
# Tx should be valid and enter the mempool, but will not be minted into the block
assert_equal(len(block["tx"]), 1)

self.rollback_to(height)

Expand Down

0 comments on commit 5755f7a

Please sign in to comment.