diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-31 19:37:43 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-31 19:37:43 +0800 |
commit | fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b (patch) | |
tree | 5f60296ff025ec08962cdd2b4f6bbcfd1479cfdb /ethpipe | |
parent | 3ee0461cb5b6e4a5e2d287180afbdb681805a662 (diff) | |
download | dexon-fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b.tar dexon-fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b.tar.gz dexon-fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b.tar.bz2 dexon-fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b.tar.lz dexon-fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b.tar.xz dexon-fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b.tar.zst dexon-fd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b.zip |
ethcrypto => crypto
Diffstat (limited to 'ethpipe')
-rw-r--r-- | ethpipe/js_pipe.go | 10 | ||||
-rw-r--r-- | ethpipe/js_types.go | 4 | ||||
-rw-r--r-- | ethpipe/pipe.go | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/ethpipe/js_pipe.go b/ethpipe/js_pipe.go index ee4637d8f..deb3cf091 100644 --- a/ethpipe/js_pipe.go +++ b/ethpipe/js_pipe.go @@ -6,7 +6,7 @@ import ( "sync/atomic" "github.com/ethereum/go-ethereum/chain" - "github.com/ethereum/go-ethereum/ethcrypto" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" ) @@ -114,7 +114,7 @@ func (self *JSPipe) IsContract(address string) bool { } func (self *JSPipe) SecretToAddress(key string) string { - pair, err := ethcrypto.NewKeyPairFromSec(ethutil.Hex2Bytes(key)) + pair, err := crypto.NewKeyPairFromSec(ethutil.Hex2Bytes(key)) if err != nil { return "" } @@ -192,12 +192,12 @@ func (self *JSPipe) Transact(key, toStr, valueStr, gasStr, gasPriceStr, codeStr } } - var keyPair *ethcrypto.KeyPair + var keyPair *crypto.KeyPair var err error if ethutil.IsHex(key) { - keyPair, err = ethcrypto.NewKeyPairFromSec([]byte(ethutil.Hex2Bytes(key[2:]))) + keyPair, err = crypto.NewKeyPairFromSec([]byte(ethutil.Hex2Bytes(key[2:]))) } else { - keyPair, err = ethcrypto.NewKeyPairFromSec([]byte(ethutil.Hex2Bytes(key))) + keyPair, err = crypto.NewKeyPairFromSec([]byte(ethutil.Hex2Bytes(key))) } if err != nil { diff --git a/ethpipe/js_types.go b/ethpipe/js_types.go index 94019f275..3daf015ca 100644 --- a/ethpipe/js_types.go +++ b/ethpipe/js_types.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/chain" - "github.com/ethereum/go-ethereum/ethcrypto" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" ) @@ -119,7 +119,7 @@ type JSKey struct { PublicKey string `json:"publicKey"` } -func NewJSKey(key *ethcrypto.KeyPair) *JSKey { +func NewJSKey(key *crypto.KeyPair) *JSKey { return &JSKey{ethutil.Bytes2Hex(key.Address()), ethutil.Bytes2Hex(key.PrivateKey), ethutil.Bytes2Hex(key.PublicKey)} } diff --git a/ethpipe/pipe.go b/ethpipe/pipe.go index 7dd6ae262..7663a1984 100644 --- a/ethpipe/pipe.go +++ b/ethpipe/pipe.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/chain" - "github.com/ethereum/go-ethereum/ethcrypto" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethlog" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" @@ -77,7 +77,7 @@ func (self *Pipe) Storage(addr, storageAddr []byte) *ethutil.Value { } func (self *Pipe) ToAddress(priv []byte) []byte { - pair, err := ethcrypto.NewKeyPairFromSec(priv) + pair, err := crypto.NewKeyPairFromSec(priv) if err != nil { return nil } @@ -89,7 +89,7 @@ func (self *Pipe) Exists(addr []byte) bool { return self.World().Get(addr) != nil } -func (self *Pipe) TransactString(key *ethcrypto.KeyPair, rec string, value, gas, price *ethutil.Value, data []byte) ([]byte, error) { +func (self *Pipe) TransactString(key *crypto.KeyPair, rec string, value, gas, price *ethutil.Value, data []byte) ([]byte, error) { // Check if an address is stored by this address var hash []byte addr := self.World().Config().Get("NameReg").StorageString(rec).Bytes() @@ -104,7 +104,7 @@ func (self *Pipe) TransactString(key *ethcrypto.KeyPair, rec string, value, gas, return self.Transact(key, hash, value, gas, price, data) } -func (self *Pipe) Transact(key *ethcrypto.KeyPair, rec []byte, value, gas, price *ethutil.Value, data []byte) ([]byte, error) { +func (self *Pipe) Transact(key *crypto.KeyPair, rec []byte, value, gas, price *ethutil.Value, data []byte) ([]byte, error) { var hash []byte var contractCreation bool if rec == nil { |