@@ -138,16 +138,16 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
138
138
}
139
139
// Quick-verify transaction and uncle lists. This mostly helps with debugging the server.
140
140
if head .UncleHash == types .EmptyUncleHash && len (body .UncleHashes ) > 0 {
141
- return nil , fmt . Errorf ("server returned non-empty uncle list but block header indicates no uncles" )
141
+ return nil , errors . New ("server returned non-empty uncle list but block header indicates no uncles" )
142
142
}
143
143
if head .UncleHash != types .EmptyUncleHash && len (body .UncleHashes ) == 0 {
144
- return nil , fmt . Errorf ("server returned empty uncle list but block header indicates uncles" )
144
+ return nil , errors . New ("server returned empty uncle list but block header indicates uncles" )
145
145
}
146
146
if head .TxHash == types .EmptyTxsHash && len (body .Transactions ) > 0 {
147
- return nil , fmt . Errorf ("server returned non-empty transaction list but block header indicates no transactions" )
147
+ return nil , errors . New ("server returned non-empty transaction list but block header indicates no transactions" )
148
148
}
149
149
if head .TxHash != types .EmptyTxsHash && len (body .Transactions ) == 0 {
150
- return nil , fmt . Errorf ("server returned empty transaction list but block header indicates transactions" )
150
+ return nil , errors . New ("server returned empty transaction list but block header indicates transactions" )
151
151
}
152
152
// Load uncles because they are not included in the block response.
153
153
var uncles []* types.Header
@@ -232,7 +232,7 @@ func (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx *
232
232
} else if json == nil {
233
233
return nil , false , ethereum .NotFound
234
234
} else if _ , r , _ := json .tx .RawSignatureValues (); r == nil {
235
- return nil , false , fmt . Errorf ("server returned transaction without signature" )
235
+ return nil , false , errors . New ("server returned transaction without signature" )
236
236
}
237
237
if json .From != nil && json .BlockHash != nil {
238
238
setSenderFromServer (json .tx , * json .From , * json .BlockHash )
@@ -284,7 +284,7 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash,
284
284
if json == nil {
285
285
return nil , ethereum .NotFound
286
286
} else if _ , r , _ := json .tx .RawSignatureValues (); r == nil {
287
- return nil , fmt . Errorf ("server returned transaction without signature" )
287
+ return nil , errors . New ("server returned transaction without signature" )
288
288
}
289
289
if json .From != nil && json .BlockHash != nil {
290
290
setSenderFromServer (json .tx , * json .From , * json .BlockHash )
@@ -421,7 +421,7 @@ func toFilterArg(q ethereum.FilterQuery) (interface{}, error) {
421
421
if q .BlockHash != nil {
422
422
arg ["blockHash" ] = * q .BlockHash
423
423
if q .FromBlock != nil || q .ToBlock != nil {
424
- return nil , fmt . Errorf ("cannot specify both BlockHash and FromBlock/ToBlock" )
424
+ return nil , errors . New ("cannot specify both BlockHash and FromBlock/ToBlock" )
425
425
}
426
426
} else {
427
427
if q .FromBlock == nil {
0 commit comments