OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modify sort for coinbase reward (#261)
[bytom/vapor.git]
/
testutil
/
hex.go
diff --git
a/testutil/hex.go
b/testutil/hex.go
index
137e0b2
..
84fbdc9
100644
(file)
--- a/
testutil/hex.go
+++ b/
testutil/hex.go
@@
-2,6
+2,7
@@
package testutil
import (
"bytes"
import (
"bytes"
+ "encoding/hex"
"io"
"testing"
"io"
"testing"
@@
-15,6
+16,14
@@
func MustDecodeHash(s string) (h bc.Hash) {
return h
}
return h
}
+func MustDecodeHexString(s string) []byte {
+ bytes, err := hex.DecodeString(s)
+ if err != nil {
+ panic(err)
+ }
+ return bytes
+}
+
func MustDecodeAsset(s string) (h bc.AssetID) {
if err := h.UnmarshalText([]byte(s)); err != nil {
panic(err)
func MustDecodeAsset(s string) (h bc.AssetID) {
if err := h.UnmarshalText([]byte(s)); err != nil {
panic(err)