always wrap errors when creating new ones with fmt.Errorf()

It doesn't really change anything in most of the cases, but it's a useful
habit anyway.

Fix #350.
This commit is contained in:
Roman Khimov 2020-08-06 19:09:57 +03:00
parent 205f52c563
commit 0e2784cd2c
24 changed files with 105 additions and 84 deletions

View file

@ -614,7 +614,7 @@ func (s *Server) getDecimals(contractID int32, cache map[int32]decimals) (decima
},
})
if err != nil {
return decimals{}, fmt.Errorf("can't create script: %v", err)
return decimals{}, fmt.Errorf("can't create script: %w", err)
}
res := s.runScriptInVM(script, nil)
if res == nil || res.State != "HALT" || len(res.Stack) == 0 {