mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-14 05:41:21 +00:00
faster binding of snatives to vm (available every call)
This commit is contained in:
@ -361,7 +361,6 @@ func ExecTx(blockCache *BlockCache, tx_ types.Tx, runCall bool, evc events.Firea
|
||||
|
||||
case *types.CallTx:
|
||||
var inAcc, outAcc *account.Account
|
||||
var isDoug bool // is this a call to the gendoug?
|
||||
|
||||
// Validate input
|
||||
inAcc = blockCache.GetAccount(tx.Input.Address)
|
||||
@ -466,14 +465,11 @@ func ExecTx(blockCache *BlockCache, tx_ types.Tx, runCall bool, evc events.Firea
|
||||
txCache.UpdateAccount(callee) // because we adjusted by input above.
|
||||
vmach := vm.NewVM(txCache, params, caller.Address, account.HashSignBytes(_s.ChainID, tx))
|
||||
vmach.SetFireable(evc)
|
||||
vmach.EnablePermissions()
|
||||
|
||||
vmach.EnablePermissions() // permission checks on CALL/CREATE
|
||||
vmach.EnableSNatives() // allows calls to snatives (with permission checks)
|
||||
|
||||
// NOTE: Call() transfers the value from caller to callee iff call succeeds.
|
||||
|
||||
if isDoug {
|
||||
// enables the snative contracts
|
||||
vmach.EnableDoug() // setupDoug(vmach, txCache, _s)
|
||||
}
|
||||
|
||||
ret, err := vmach.Call(caller, callee, code, tx.Data, value, &gas)
|
||||
exception := ""
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user