Skip to content

Commit

Permalink
all: fix rename breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Oct 31, 2014
1 parent 5af4ff9 commit f347331
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 69 deletions.
10 changes: 5 additions & 5 deletions chain/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"container/list"
"fmt"

"github.com/ethereum/go-ethereum/ethcrypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ethwire"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/wire"
)

// Implement our EthTest Manager
Expand Down Expand Up @@ -53,14 +53,14 @@ func (tm *TestManager) StateManager() *StateManager {
func (tm *TestManager) EventMux() *event.TypeMux {
return tm.eventMux
}
func (tm *TestManager) Broadcast(msgType ethwire.MsgType, data []interface{}) {
func (tm *TestManager) Broadcast(msgType wire.MsgType, data []interface{}) {
fmt.Println("Broadcast not implemented")
}

func (tm *TestManager) ClientIdentity() ethwire.ClientIdentity {
func (tm *TestManager) ClientIdentity() wire.ClientIdentity {
return nil
}
func (tm *TestManager) KeyManager() *ethcrypto.KeyManager {
func (tm *TestManager) KeyManager() *crypto.KeyManager {
return nil
}

Expand Down
3 changes: 1 addition & 2 deletions cmd/ethereum/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethgo.old/ethlog"
)

const (
Expand Down Expand Up @@ -131,5 +130,5 @@ func main() {

// this blocks the thread
ethereum.WaitForShutdown()
ethlog.Flush()
logger.Flush()
}
4 changes: 2 additions & 2 deletions p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync"
"time"

"github.com/ethereum/eth-go/ethlog"
logpkg "github.com/ethereum/go-ethereum/logger"
)

const (
Expand Down Expand Up @@ -93,7 +93,7 @@ type Server struct {
handlers Handlers
}

var logger = ethlog.NewLogger("P2P")
var logger = logpkg.NewLogger("P2P")

func New(network Network, addr net.Addr, identity ClientIdentity, handlers Handlers, maxPeers int, blacklist Blacklist) *Server {
// get alphabetical list of protocol names from handlers map
Expand Down
4 changes: 2 additions & 2 deletions pow/ar/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package ar
import (
"math/big"

"github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/trie"
)

type Block interface {
Trie() *ethtrie.Trie
Trie() *trie.Trie
Diff() *big.Int
}
8 changes: 4 additions & 4 deletions pow/ar/pow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ import (
"testing"

"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/trie"
)

type TestBlock struct {
trie *ethtrie.Trie
trie *trie.Trie
}

func NewTestBlock() *TestBlock {
db, _ := ethdb.NewMemDatabase()
return &TestBlock{
trie: ethtrie.New(db, ""),
trie: trie.New(db, ""),
}
}

func (self *TestBlock) Diff() *big.Int {
return b(10)
}

func (self *TestBlock) Trie() *ethtrie.Trie {
func (self *TestBlock) Trie() *trie.Trie {
return self.trie
}

Expand Down
8 changes: 4 additions & 4 deletions pow/ar/rnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ar
import (
"math/big"

"github.com/ethereum/go-ethereum/ethcrypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
)

Expand All @@ -21,16 +21,16 @@ func (self ByteNode) Big() *big.Int {

func Sha3(v interface{}) *big.Int {
if b, ok := v.(*big.Int); ok {
return ethutil.BigD(ethcrypto.Sha3(b.Bytes()))
return ethutil.BigD(crypto.Sha3(b.Bytes()))
} else if b, ok := v.([]interface{}); ok {
return ethutil.BigD(ethcrypto.Sha3(ethutil.Encode(b)))
return ethutil.BigD(crypto.Sha3(ethutil.Encode(b)))
} else if s, ok := v.([]*big.Int); ok {
v := make([]interface{}, len(s))
for i, b := range s {
v[i] = b
}

return ethutil.BigD(ethcrypto.Sha3(ethutil.Encode(v)))
return ethutil.BigD(crypto.Sha3(ethutil.Encode(v)))
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethtrie"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/trie"
)

var ZeroHash256 = make([]byte, 32)
Expand All @@ -15,7 +15,7 @@ func TestSnapshot(t *testing.T) {
ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "")
ethutil.Config.Db = db

state := New(ethtrie.New(db, ""))
state := New(trie.New(db, ""))

stateObject := state.GetOrNewStateObject([]byte("aa"))

Expand Down
8 changes: 4 additions & 4 deletions tests/ethtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os"
"strings"

"github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/tests/helper"
)

Expand All @@ -20,8 +20,8 @@ type Account struct {
Storage map[string]string
}

func StateObjectFromAccount(addr string, account Account) *ethstate.StateObject {
obj := ethstate.NewStateObject(ethutil.Hex2Bytes(addr))
func StateObjectFromAccount(addr string, account Account) *state.StateObject {
obj := state.NewStateObject(ethutil.Hex2Bytes(addr))
obj.SetBalance(ethutil.Big(account.Balance))

if ethutil.IsHex(account.Code) {
Expand Down Expand Up @@ -53,7 +53,7 @@ func RunVmTest(js string) (failed int) {
}

for name, test := range tests {
state := ethstate.New(helper.NewTrie())
state := state.New(helper.NewTrie())
for addr, account := range test.Pre {
obj := StateObjectFromAccount(addr, account)
state.SetStateObject(obj)
Expand Down
10 changes: 5 additions & 5 deletions tests/helper/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import (
"log"
"os"

"github.com/ethereum/go-ethereum/ethlog"
"github.com/ethereum/go-ethereum/ethutil"
logpkg "github.com/ethereum/go-ethereum/logger"
)

var Logger ethlog.LogSystem
var Log = ethlog.NewLogger("TEST")
var Logger logpkg.LogSystem
var Log = logpkg.NewLogger("TEST")

func init() {
Logger = ethlog.NewStdLogSystem(os.Stdout, log.LstdFlags, ethlog.InfoLevel)
ethlog.AddLogSystem(Logger)
Logger = logpkg.NewStdLogSystem(os.Stdout, log.LstdFlags, logpkg.InfoLevel)
logpkg.AddLogSystem(Logger)

ethutil.ReadConfig(".ethtest", "/tmp/ethtest", "")
}
6 changes: 3 additions & 3 deletions tests/helper/trie.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package helper

import "github.com/ethereum/go-ethereum/ethtrie"
import "github.com/ethereum/go-ethereum/trie"

type MemDatabase struct {
db map[string][]byte
Expand All @@ -24,8 +24,8 @@ func (db *MemDatabase) Print() {}
func (db *MemDatabase) Close() {}
func (db *MemDatabase) LastKnownTD() []byte { return nil }

func NewTrie() *ethtrie.Trie {
func NewTrie() *trie.Trie {
db, _ := NewMemDatabase()

return ethtrie.New(db, "")
return trie.New(db, "")
}
30 changes: 15 additions & 15 deletions tests/helper/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package helper
import (
"math/big"

"github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)

type Env struct {
state *ethstate.State
state *state.State

origin []byte
parent []byte
Expand All @@ -21,13 +21,13 @@ type Env struct {
gasLimit *big.Int
}

func NewEnv(state *ethstate.State) *Env {
func NewEnv(state *state.State) *Env {
return &Env{
state: state,
}
}

func NewEnvFromMap(state *ethstate.State, envValues map[string]string, exeValues map[string]string) *Env {
func NewEnvFromMap(state *state.State, envValues map[string]string, exeValues map[string]string) *Env {
env := NewEnv(state)

env.origin = ethutil.Hex2Bytes(exeValues["caller"])
Expand All @@ -41,21 +41,21 @@ func NewEnvFromMap(state *ethstate.State, envValues map[string]string, exeValues
return env
}

func (self *Env) Origin() []byte { return self.origin }
func (self *Env) BlockNumber() *big.Int { return self.number }
func (self *Env) PrevHash() []byte { return self.parent }
func (self *Env) Coinbase() []byte { return self.coinbase }
func (self *Env) Time() int64 { return self.time }
func (self *Env) Difficulty() *big.Int { return self.difficulty }
func (self *Env) BlockHash() []byte { return nil }
func (self *Env) State() *ethstate.State { return self.state }
func (self *Env) GasLimit() *big.Int { return self.gasLimit }
func (self *Env) AddLog(vm.Log) {}
func (self *Env) Origin() []byte { return self.origin }
func (self *Env) BlockNumber() *big.Int { return self.number }
func (self *Env) PrevHash() []byte { return self.parent }
func (self *Env) Coinbase() []byte { return self.coinbase }
func (self *Env) Time() int64 { return self.time }
func (self *Env) Difficulty() *big.Int { return self.difficulty }
func (self *Env) BlockHash() []byte { return nil }
func (self *Env) State() *state.State { return self.state }
func (self *Env) GasLimit() *big.Int { return self.gasLimit }
func (self *Env) AddLog(vm.Log) {}
func (self *Env) Transfer(from, to vm.Account, amount *big.Int) error {
return vm.Transfer(from, to, amount)
}

func RunVm(state *ethstate.State, env, exec map[string]string) ([]byte, *big.Int, error) {
func RunVm(state *state.State, env, exec map[string]string) ([]byte, *big.Int, error) {
address := FromHex(exec["address"])
caller := state.GetOrNewStateObject(FromHex(exec["caller"]))

Expand Down
8 changes: 4 additions & 4 deletions tests/vm/gh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"testing"

"github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/tests/helper"
)

Expand All @@ -16,8 +16,8 @@ type Account struct {
Storage map[string]string
}

func StateObjectFromAccount(addr string, account Account) *ethstate.StateObject {
obj := ethstate.NewStateObject(ethutil.Hex2Bytes(addr))
func StateObjectFromAccount(addr string, account Account) *state.StateObject {
obj := state.NewStateObject(ethutil.Hex2Bytes(addr))
obj.SetBalance(ethutil.Big(account.Balance))

if ethutil.IsHex(account.Code) {
Expand All @@ -44,7 +44,7 @@ func RunVmTest(p string, t *testing.T) {
helper.CreateFileTests(t, p, &tests)

for name, test := range tests {
state := ethstate.New(helper.NewTrie())
state := state.New(helper.NewTrie())
for addr, account := range test.Pre {
obj := StateObjectFromAccount(addr, account)
state.SetStateObject(obj)
Expand Down
Loading

0 comments on commit f347331

Please sign in to comment.