aboutsummaryrefslogtreecommitdiffstats
path: root/common/big_test.go
diff options
context:
space:
mode:
authorjohnliu-dexon <42129254+johnliu-dexon@users.noreply.github.com>2019-01-17 16:37:15 +0800
committerWei-Ning Huang <w@dexon.org>2019-01-17 16:37:15 +0800
commitcd491a6cb58c8f138d449b24bfecab0e37fa598f (patch)
tree35fc3341f00b43f44abe9382e179e1e4ba7c3e36 /common/big_test.go
parenta6401d01d43d806f4d5e71cfdf2848001df9e129 (diff)
downloaddexon-cd491a6cb58c8f138d449b24bfecab0e37fa598f.tar
dexon-cd491a6cb58c8f138d449b24bfecab0e37fa598f.tar.gz
dexon-cd491a6cb58c8f138d449b24bfecab0e37fa598f.tar.bz2
dexon-cd491a6cb58c8f138d449b24bfecab0e37fa598f.tar.lz
dexon-cd491a6cb58c8f138d449b24bfecab0e37fa598f.tar.xz
dexon-cd491a6cb58c8f138d449b24bfecab0e37fa598f.tar.zst
dexon-cd491a6cb58c8f138d449b24bfecab0e37fa598f.zip
common: fix big scan from bytes (#157)
We store string of number, not bytes value into database 10 is stored as 0x3130, not 0x0a Use UnmarshalText instead of SetBytes
Diffstat (limited to 'common/big_test.go')
-rw-r--r--common/big_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/big_test.go b/common/big_test.go
index 0339b4760..5ce9091ec 100644
--- a/common/big_test.go
+++ b/common/big_test.go
@@ -31,7 +31,7 @@ func TestBig_Scan(t *testing.T) {
},
{
name: "scan bytes",
- args: args{src: []byte{0x0a}},
+ args: args{src: []byte{0x31, 0x30}},
value: Big(*big.NewInt(10)),
wantErr: false,
},