aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-05-13 01:00:35 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-05-13 01:00:35 +0800
commitd6357aa616715df1e98cfb90c3aa5372e15cc24b (patch)
tree3f1792e7d71a82de0ceb6047eaf87f2f72aa82ff /rpc
parent58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd (diff)
parente389585f1f2e77fd7cd507499015bf3754581e4e (diff)
downloadgo-tangerine-d6357aa616715df1e98cfb90c3aa5372e15cc24b.tar
go-tangerine-d6357aa616715df1e98cfb90c3aa5372e15cc24b.tar.gz
go-tangerine-d6357aa616715df1e98cfb90c3aa5372e15cc24b.tar.bz2
go-tangerine-d6357aa616715df1e98cfb90c3aa5372e15cc24b.tar.lz
go-tangerine-d6357aa616715df1e98cfb90c3aa5372e15cc24b.tar.xz
go-tangerine-d6357aa616715df1e98cfb90c3aa5372e15cc24b.tar.zst
go-tangerine-d6357aa616715df1e98cfb90c3aa5372e15cc24b.zip
Merge pull request #631 from Gustav-Simonsson/improve_key_store_crypto
Improve key store crypto
Diffstat (limited to 'rpc')
-rw-r--r--rpc/types.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/rpc/types.go b/rpc/types.go
index e6eb4f856..1f49a3dea 100644
--- a/rpc/types.go
+++ b/rpc/types.go
@@ -18,6 +18,7 @@ package rpc
import (
"encoding/binary"
+ "encoding/hex"
"encoding/json"
"fmt"
"math/big"
@@ -117,7 +118,13 @@ func newHexData(input interface{}) *hexdata {
binary.BigEndian.PutUint32(buff, input)
d.data = buff
case string: // hexstring
- d.data = common.Big(input).Bytes()
+ // aaargh ffs TODO: avoid back-and-forth hex encodings where unneeded
+ bytes, err := hex.DecodeString(strings.TrimPrefix(input, "0x"))
+ if err != nil {
+ d.isNil = true
+ } else {
+ d.data = bytes
+ }
default:
d.isNil = true
}