mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-23 04:08:09 +00:00
Change signer.balance assertion location (#3681)
Signed-off-by: Tim Beiko <t.beiko23@gmail.com>
This commit is contained in:
parent
9935b5033e
commit
5cd3cc6797
@ -206,6 +206,8 @@ class World(ABC):
|
||||
|
||||
signer.balance -= transaction.amount
|
||||
assert signer.balance >= 0, 'invalid transaction: signer does not have enough ETH to cover attached value'
|
||||
# the signer must be able to afford the transaction
|
||||
assert signer.balance >= transaction.gas_limit * transaction.max_fee_per_gas
|
||||
|
||||
# ensure that the user was willing to at least pay the base fee
|
||||
assert transaction.max_fee_per_gas >= block.base_fee_per_gas
|
||||
@ -217,8 +219,6 @@ class World(ABC):
|
||||
assert transaction.max_priority_fee_per_gas < 2**256
|
||||
# The total must be the larger of the two
|
||||
assert transaction.max_fee_per_gas >= transaction.max_priority_fee_per_gas
|
||||
# the signer must be able to afford the transaction
|
||||
assert signer.balance >= transaction.gas_limit * transaction.max_fee_per_gas
|
||||
|
||||
# priority fee is capped because the base fee is filled first
|
||||
priority_fee_per_gas = min(transaction.max_priority_fee_per_gas, transaction.max_fee_per_gas - block.base_fee_per_gas)
|
||||
|
Loading…
x
Reference in New Issue
Block a user