// If the tx is invalid, an error will be returned. // Unlike ExecBlock(), state will not be altered. func(exe *executor)Execute(txEnv *txs.Envelope)(txe *exec.TxExecution, err error) { ...... // Verify transaction signature against inputs err = txEnv.Verify(exe.params.ChainID) if err != nil { logger.InfoMsg("Transaction Verify failed", structure.ErrorKey, err) returnnil, err }
if txExecutor, ok := exe.contexts[txEnv.Tx.Type()]; ok { // Establish new TxExecution txe := exe.block.Tx(txEnv) deferfunc() { if r := recover(); r != nil { err = fmt.Errorf("recovered from panic in executor.Execute(%s): %v\n%s", txEnv.String(), r, debug.Stack()) } }()
func(ctx *CallContext)Execute(txe *exec.TxExecution, p payload.Payload)error { var ok bool ctx.tx, ok = p.(*payload.CallTx) if !ok { return fmt.Errorf("payload must be CallTx, but is: %v", p) } ctx.txe = txe inAcc, outAcc, err := ctx.Precheck() if err != nil { return err } // That the fee less than the input amount is checked by Precheck to be greater than or equal to fee value := ctx.tx.Input.Amount - ctx.tx.Fee