Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
libangzhu authored and vipwzw committed May 17, 2023
1 parent 8d7e791 commit faa1a26
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions plugin/dapp/evm/executor/exec_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@ func (evm *EVMExecutor) ExecLocal(tx *types.Transaction, receipt *types.ReceiptD
defer func(lSet *types.LocalDBSet) {
if types.IsEthSignID(tx.GetSignature().GetTy()) {
nonceLocalKey := secp256k1eth.CaculCoinsEvmAccountKey(tx.From())
nonceV, err := evm.GetLocalDB().Get(nonceLocalKey)
var evmNonce types.EvmAccountNonce
if err == nil {
nonceV, nonceErr := evm.GetLocalDB().Get(nonceLocalKey)
if nonceErr == nil {
types.Decode(nonceV, &evmNonce)
if evmNonce.GetNonce() == tx.GetNonce() {
evmNonce.Nonce++
} else { //nonce 错误 返回异常
if evm.GetAPI().GetConfig().IsDappFork(evm.GetHeight(), "evm", evmtypes.ForkEvmExecNonce) {
err = errors.New("invalid nonce")
return
}

} else if evm.GetAPI().GetConfig().IsDappFork(evm.GetHeight(), "evm", evmtypes.ForkEvmExecNonce) { //nonce 错误 返回异常
err = errors.New("invalid nonce")
return
}

} else {
Expand Down

0 comments on commit faa1a26

Please sign in to comment.