Skip to content

Commit fd9da72

Browse files
committed
ethcrypto => crypto
1 parent 3ee0461 commit fd9da72

27 files changed

Lines changed: 69 additions & 69 deletions

‎chain/block.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"sort"
88
"time"
99

10-
"github.com/ethereum/go-ethereum/ethcrypto"
10+
"github.com/ethereum/go-ethereum/crypto"
1111
"github.com/ethereum/go-ethereum/ethstate"
1212
"github.com/ethereum/go-ethereum/ethtrie"
1313
"github.com/ethereum/go-ethereum/ethutil"
@@ -144,12 +144,12 @@ func CreateBlock(root interface{},
144144

145145
// Returns a hash of the block
146146
func (block *Block) Hash() ethutil.Bytes {
147-
return ethcrypto.Sha3(ethutil.NewValue(block.header()).Encode())
148-
//return ethcrypto.Sha3(block.Value().Encode())
147+
return crypto.Sha3(ethutil.NewValue(block.header()).Encode())
148+
//return crypto.Sha3(block.Value().Encode())
149149
}
150150

151151
func (block *Block) HashNoNonce() []byte {
152-
return ethcrypto.Sha3(ethutil.Encode(block.miningHeader()))
152+
return crypto.Sha3(ethutil.Encode(block.miningHeader()))
153153
}
154154

155155
func (block *Block) State() *ethstate.State {
@@ -232,7 +232,7 @@ func (block *Block) rlpUncles() interface{} {
232232

233233
func (block *Block) SetUncles(uncles []*Block) {
234234
block.Uncles = uncles
235-
block.UncleSha = ethcrypto.Sha3(ethutil.Encode(block.rlpUncles()))
235+
block.UncleSha = crypto.Sha3(ethutil.Encode(block.rlpUncles()))
236236
}
237237

238238
func (self *Block) SetReceipts(receipts Receipts) {

‎chain/dagger.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"math/rand"
77
"time"
88

9-
"github.com/ethereum/go-ethereum/ethcrypto"
9+
"github.com/ethereum/go-ethereum/crypto"
1010
"github.com/ethereum/go-ethereum/ethlog"
1111
"github.com/ethereum/go-ethereum/ethutil"
1212
"github.com/obscuren/sha3"
@@ -60,7 +60,7 @@ func (pow *EasyPow) Search(block *Block, stop <-chan struct{}) []byte {
6060
t = time.Now()
6161
}
6262

63-
sha := ethcrypto.Sha3(big.NewInt(r.Int63()).Bytes())
63+
sha := crypto.Sha3(big.NewInt(r.Int63()).Bytes())
6464
if pow.Verify(hash, diff, sha) {
6565
return sha
6666
}

‎chain/genesis.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package chain
33
import (
44
"math/big"
55

6-
"github.com/ethereum/go-ethereum/ethcrypto"
6+
"github.com/ethereum/go-ethereum/crypto"
77
"github.com/ethereum/go-ethereum/ethutil"
88
)
99

@@ -14,7 +14,7 @@ import (
1414
var ZeroHash256 = make([]byte, 32)
1515
var ZeroHash160 = make([]byte, 20)
1616
var ZeroHash512 = make([]byte, 64)
17-
var EmptyShaList = ethcrypto.Sha3(ethutil.Encode([]interface{}{}))
17+
var EmptyShaList = crypto.Sha3(ethutil.Encode([]interface{}{}))
1818

1919
var GenesisHeader = []interface{}{
2020
// Previous hash (none)
@@ -47,7 +47,7 @@ var GenesisHeader = []interface{}{
4747
// Extra
4848
nil,
4949
// Nonce
50-
ethcrypto.Sha3(big.NewInt(42).Bytes()),
50+
crypto.Sha3(big.NewInt(42).Bytes()),
5151
}
5252

5353
var Genesis = []interface{}{GenesisHeader, []interface{}{}, []interface{}{}}

‎chain/state_manager.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"sync"
1010
"time"
1111

12-
"github.com/ethereum/go-ethereum/ethcrypto"
12+
"github.com/ethereum/go-ethereum/crypto"
1313
"github.com/ethereum/go-ethereum/ethlog"
1414
"github.com/ethereum/go-ethereum/ethstate"
1515
"github.com/ethereum/go-ethereum/ethutil"
@@ -40,7 +40,7 @@ type EthManager interface {
4040
IsMining() bool
4141
IsListening() bool
4242
Peers() *list.List
43-
KeyManager() *ethcrypto.KeyManager
43+
KeyManager() *crypto.KeyManager
4444
ClientIdentity() ethwire.ClientIdentity
4545
Db() ethutil.Database
4646
EventMux() *event.TypeMux

‎chain/transaction.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"math/big"
77

8-
"github.com/ethereum/go-ethereum/ethcrypto"
8+
"github.com/ethereum/go-ethereum/crypto"
99
"github.com/ethereum/go-ethereum/ethstate"
1010
"github.com/ethereum/go-ethereum/ethutil"
1111
"github.com/obscuren/secp256k1-go"
@@ -66,7 +66,7 @@ func (self *Transaction) TotalValue() *big.Int {
6666
func (tx *Transaction) Hash() []byte {
6767
data := []interface{}{tx.Nonce, tx.GasPrice, tx.Gas, tx.Recipient, tx.Value, tx.Data}
6868

69-
return ethcrypto.Sha3(ethutil.NewValue(data).Encode())
69+
return crypto.Sha3(ethutil.NewValue(data).Encode())
7070
}
7171

7272
func (tx *Transaction) CreatesContract() bool {
@@ -80,9 +80,9 @@ func (tx *Transaction) IsContract() bool {
8080

8181
func (tx *Transaction) CreationAddress(state *ethstate.State) []byte {
8282
// Generate a new address
83-
addr := ethcrypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:]
83+
addr := crypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:]
8484
//for i := uint64(0); state.GetStateObject(addr) != nil; i++ {
85-
// addr = ethcrypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce + i}).Encode())[12:]
85+
// addr = crypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce + i}).Encode())[12:]
8686
//}
8787

8888
return addr
@@ -106,7 +106,7 @@ func (tx *Transaction) PublicKey() []byte {
106106
sig := append(r, s...)
107107
sig = append(sig, tx.v-27)
108108

109-
pubkey := ethcrypto.Ecrecover(append(hash, sig...))
109+
pubkey := crypto.Ecrecover(append(hash, sig...))
110110
//pubkey, _ := secp256k1.RecoverPubkey(hash, sig)
111111

112112
return pubkey
@@ -121,7 +121,7 @@ func (tx *Transaction) Sender() []byte {
121121
return nil
122122
}
123123

124-
return ethcrypto.Sha3(pubkey[1:])[12:]
124+
return crypto.Sha3(pubkey[1:])[12:]
125125
}
126126

127127
func (tx *Transaction) Sign(privk []byte) error {

‎cmd/ethereum/main.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"os"
2323
"runtime"
2424

25-
"github.com/ethereum/go-ethereum/ethchain"
25+
"github.com/ethereum/go-ethereum/chain"
2626
"github.com/ethereum/go-ethereum/ethlog"
2727
"github.com/ethereum/go-ethereum/ethutil"
2828
"github.com/ethereum/go-ethereum/utils"
@@ -74,7 +74,7 @@ func main() {
7474
ethereum := utils.NewEthereum(db, clientIdentity, keyManager, UseUPnP, OutboundPort, MaxPeer)
7575

7676
if Dump {
77-
var block *ethchain.Block
77+
var block *chain.Block
7878

7979
if len(DumpHash) == 0 && DumpNumber == -1 {
8080
block = ethereum.ChainManager().CurrentBlock

‎cmd/mist/ui_lib.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626

2727
"github.com/ethereum/go-ethereum"
2828
"github.com/ethereum/go-ethereum/chain"
29-
"github.com/ethereum/go-ethereum/ethcrypto"
29+
"github.com/ethereum/go-ethereum/crypto"
3030
"github.com/ethereum/go-ethereum/ethpipe"
3131
"github.com/ethereum/go-ethereum/ethstate"
3232
"github.com/ethereum/go-ethereum/ethutil"
@@ -69,7 +69,7 @@ func (self *UiLib) LookupDomain(domain string) string {
6969
world := self.World()
7070

7171
if len(domain) > 32 {
72-
domain = string(ethcrypto.Sha3([]byte(domain)))
72+
domain = string(crypto.Sha3([]byte(domain)))
7373
}
7474
data := world.Config().Get("DnsReg").StorageString(domain).Bytes()
7575

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethcrypto
1+
package crypto
22

33
import (
44
"crypto/sha256"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethcrypto
1+
package crypto
22

33
import (
44
"bytes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ethcrypto
1+
package crypto
22

33
import (
44
"fmt"

0 commit comments

Comments
 (0)