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

@ -690,7 +690,7 @@ var rpcClientTestCases = map[string][]rpcClientTestCase{
result: func(c *Client) interface{} {
h, err := util.Uint256DecodeStringLE("72159b0cf1221110daad6e1df6ef4ff03012173b63c86910bd7134deb659c875")
if err != nil {
panic(fmt.Errorf("can't decode `sendrawtransaction` result hash: %v", err))
panic(fmt.Errorf("can't decode `sendrawtransaction` result hash: %w", err))
}
return h
},
@ -710,7 +710,7 @@ var rpcClientTestCases = map[string][]rpcClientTestCase{
result: func(c *Client) interface{} {
h, err := util.Uint256DecodeStringLE("1bdea8f80eb5bd97fade38d5e7fb93b02c9d3e01394e9f4324218132293f7ea6")
if err != nil {
panic(fmt.Errorf("can't decode `submitblock` result hash: %v", err))
panic(fmt.Errorf("can't decode `submitblock` result hash: %w", err))
}
return h
},