mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-27 04:26:07 +00:00
move 'tx.getRecipient' into 'setupComputation'
This commit is contained in:
parent
37c282f1b9
commit
ec8abf40e4
@ -28,9 +28,7 @@ proc processTransaction*(tx: Transaction, sender: EthAddress, vmState: BaseVMSta
|
|||||||
var balance = vmState.readOnlyStateDb().getBalance(sender)
|
var balance = vmState.readOnlyStateDb().getBalance(sender)
|
||||||
if balance < upfrontGasCost: break
|
if balance < upfrontGasCost: break
|
||||||
|
|
||||||
let recipient = tx.getRecipient()
|
var c = setupComputation(vmState, tx, sender, fork)
|
||||||
|
|
||||||
var c = setupComputation(vmState, tx, sender, recipient, fork)
|
|
||||||
if c.isNil: # OOG in setupComputation
|
if c.isNil: # OOG in setupComputation
|
||||||
gasUsed = 0
|
gasUsed = 0
|
||||||
break
|
break
|
||||||
|
@ -26,7 +26,7 @@ proc validateTransaction*(vmState: BaseVMState, tx: Transaction, sender: EthAddr
|
|||||||
tx.accountNonce == account.nonce and
|
tx.accountNonce == account.nonce and
|
||||||
account.balance >= gasCost
|
account.balance >= gasCost
|
||||||
|
|
||||||
proc setupComputation*(vmState: BaseVMState, tx: Transaction, sender, recipient: EthAddress, fork: Fork) : Computation =
|
proc setupComputation*(vmState: BaseVMState, tx: Transaction, sender: EthAddress, fork: Fork) : Computation =
|
||||||
var gas = tx.gasLimit - tx.intrinsicGas(fork)
|
var gas = tx.gasLimit - tx.intrinsicGas(fork)
|
||||||
|
|
||||||
# TODO: refactor message to use byterange
|
# TODO: refactor message to use byterange
|
||||||
@ -55,7 +55,7 @@ proc setupComputation*(vmState: BaseVMState, tx: Transaction, sender, recipient:
|
|||||||
depth: 0,
|
depth: 0,
|
||||||
gas: gas,
|
gas: gas,
|
||||||
sender: sender,
|
sender: sender,
|
||||||
contractAddress: recipient,
|
contractAddress: tx.getRecipient(),
|
||||||
codeAddress: tx.to,
|
codeAddress: tx.to,
|
||||||
value: tx.value,
|
value: tx.value,
|
||||||
data: data,
|
data: data,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user