Skip to content

Commit

Permalink
adjust validate service api order (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanZiWen authored and laizy committed Sep 28, 2018
1 parent a814f51 commit 8e07248
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions smartcontract/service/neovm/neovm_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,18 @@ func (this *NeoVmService) SystemCall(engine *vm.ExecutionEngine) error {
if !ok {
return errors.NewErr(fmt.Sprintf("[SystemCall] service not support: %s", serviceName))
}
if service.Validator != nil {
if err := service.Validator(engine); err != nil {
return errors.NewDetailErr(err, errors.ErrNoCode, "[SystemCall] service validator error!")
}
}
price, err := GasPrice(engine, serviceName)
if err != nil {
return err
}
if !this.ContextRef.CheckUseGas(price) {
return ERR_GAS_INSUFFICIENT
}
if service.Validator != nil {
if err := service.Validator(engine); err != nil {
return errors.NewDetailErr(err, errors.ErrNoCode, "[SystemCall] service validator error!")
}
}

if err := service.Execute(this, engine); err != nil {
return errors.NewDetailErr(err, errors.ErrNoCode, "[SystemCall] service execute error!")
}
Expand Down

0 comments on commit 8e07248

Please sign in to comment.