1 package chain 2 3 import ( 4 "encoding/hex" 5 "errors" 6 "fmt" 7 ) 8 9 func hexDecode(s string) ([]byte, error) { 10 b, err := hex.DecodeString(s) 11 if err != nil { 12 return nil, err 13 } 14 if len(b) == 0 { 15 return nil, errors.New("empty hex") 16 } 17 return b, nil 18 } 19 20 var _ = fmt.Sprintf 21