mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 19:36:44 +01:00
Wrap all errors with tracerr
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
ethCommon "github.com/ethereum/go-ethereum/common"
|
||||
"github.com/hermeznetwork/tracerr"
|
||||
)
|
||||
|
||||
// tokenIDBytesLen defines the length of the TokenID byte array representation
|
||||
@@ -47,7 +48,7 @@ func (t TokenID) BigInt() *big.Int {
|
||||
// TokenIDFromBytes returns TokenID from a byte array
|
||||
func TokenIDFromBytes(b []byte) (TokenID, error) {
|
||||
if len(b) != tokenIDBytesLen {
|
||||
return 0, fmt.Errorf("can not parse TokenID, bytes len %d, expected 4", len(b))
|
||||
return 0, tracerr.Wrap(fmt.Errorf("can not parse TokenID, bytes len %d, expected 4", len(b)))
|
||||
}
|
||||
tid := binary.BigEndian.Uint32(b[:4])
|
||||
return TokenID(tid), nil
|
||||
|
||||
Reference in New Issue
Block a user