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)
|
||||
if balance < upfrontGasCost: break
|
||||
|
||||
let recipient = tx.getRecipient()
|
||||
|
||||
var c = setupComputation(vmState, tx, sender, recipient, fork)
|
||||
var c = setupComputation(vmState, tx, sender, fork)
|
||||
if c.isNil: # OOG in setupComputation
|
||||
gasUsed = 0
|
||||
break
|
||||
|
|
|
@ -26,7 +26,7 @@ proc validateTransaction*(vmState: BaseVMState, tx: Transaction, sender: EthAddr
|
|||
tx.accountNonce == account.nonce and
|
||||
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)
|
||||
|
||||
# TODO: refactor message to use byterange
|
||||
|
@ -55,7 +55,7 @@ proc setupComputation*(vmState: BaseVMState, tx: Transaction, sender, recipient:
|
|||
depth: 0,
|
||||
gas: gas,
|
||||
sender: sender,
|
||||
contractAddress: recipient,
|
||||
contractAddress: tx.getRecipient(),
|
||||
codeAddress: tx.to,
|
||||
value: tx.value,
|
||||
data: data,
|
||||
|
|
Loading…
Reference in New Issue