diff options
Diffstat (limited to 'ethpipe')
-rw-r--r-- | ethpipe/js_pipe.go | 14 | ||||
-rw-r--r-- | ethpipe/js_types.go | 16 | ||||
-rw-r--r-- | ethpipe/pipe.go | 20 | ||||
-rw-r--r-- | ethpipe/vm_env.go | 6 |
4 files changed, 28 insertions, 28 deletions
diff --git a/ethpipe/js_pipe.go b/ethpipe/js_pipe.go index 4b4369768..ee4637d8f 100644 --- a/ethpipe/js_pipe.go +++ b/ethpipe/js_pipe.go @@ -5,7 +5,7 @@ import ( "encoding/json" "sync/atomic" - "github.com/ethereum/go-ethereum/ethchain" + "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/ethcrypto" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" @@ -15,7 +15,7 @@ type JSPipe struct { *Pipe } -func NewJSPipe(eth ethchain.EthManager) *JSPipe { +func NewJSPipe(eth chain.EthManager) *JSPipe { return &JSPipe{New(eth)} } @@ -63,7 +63,7 @@ func (self *JSPipe) PeerCount() int { func (self *JSPipe) Peers() []JSPeer { var peers []JSPeer for peer := self.obj.Peers().Front(); peer != nil; peer = peer.Next() { - p := peer.Value.(ethchain.Peer) + p := peer.Value.(chain.Peer) // we only want connected peers if atomic.LoadInt32(p.Connected()) != 0 { peers = append(peers, *NewJSPeer(p)) @@ -209,7 +209,7 @@ func (self *JSPipe) Transact(key, toStr, valueStr, gasStr, gasPriceStr, codeStr gas = ethutil.Big(gasStr) gasPrice = ethutil.Big(gasPriceStr) data []byte - tx *ethchain.Transaction + tx *chain.Transaction ) if ethutil.IsHex(codeStr) { @@ -219,9 +219,9 @@ func (self *JSPipe) Transact(key, toStr, valueStr, gasStr, gasPriceStr, codeStr } if contractCreation { - tx = ethchain.NewContractCreationTx(value, gas, gasPrice, data) + tx = chain.NewContractCreationTx(value, gas, gasPrice, data) } else { - tx = ethchain.NewTransactionMessage(hash, value, gas, gasPrice, data) + tx = chain.NewTransactionMessage(hash, value, gas, gasPrice, data) } acc := self.obj.StateManager().TransState().GetOrNewStateObject(keyPair.Address()) @@ -240,7 +240,7 @@ func (self *JSPipe) Transact(key, toStr, valueStr, gasStr, gasPriceStr, codeStr } func (self *JSPipe) PushTx(txStr string) (*JSReceipt, error) { - tx := ethchain.NewTransactionFromBytes(ethutil.Hex2Bytes(txStr)) + tx := chain.NewTransactionFromBytes(ethutil.Hex2Bytes(txStr)) self.obj.TxPool().QueueTransaction(tx) return NewJSReciept(tx.CreatesContract(), tx.CreationAddress(self.World().State()), tx.Hash(), tx.Sender()), nil } diff --git a/ethpipe/js_types.go b/ethpipe/js_types.go index 956a49ab7..94019f275 100644 --- a/ethpipe/js_types.go +++ b/ethpipe/js_types.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/ethchain" + "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/ethcrypto" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" @@ -14,7 +14,7 @@ import ( // Block interface exposed to QML type JSBlock struct { //Transactions string `json:"transactions"` - ref *ethchain.Block + ref *chain.Block Size string `json:"size"` Number int `json:"number"` Hash string `json:"hash"` @@ -29,7 +29,7 @@ type JSBlock struct { } // Creates a new QML Block from a chain block -func NewJSBlock(block *ethchain.Block) *JSBlock { +func NewJSBlock(block *chain.Block) *JSBlock { if block == nil { return &JSBlock{} } @@ -75,7 +75,7 @@ func (self *JSBlock) GetTransaction(hash string) *JSTransaction { } type JSTransaction struct { - ref *ethchain.Transaction + ref *chain.Transaction Value string `json:"value"` Gas string `json:"gas"` @@ -90,7 +90,7 @@ type JSTransaction struct { Confirmations int `json:"confirmations"` } -func NewJSTx(tx *ethchain.Transaction, state *ethstate.State) *JSTransaction { +func NewJSTx(tx *chain.Transaction, state *ethstate.State) *JSTransaction { hash := ethutil.Bytes2Hex(tx.Hash()) receiver := ethutil.Bytes2Hex(tx.Recipient) if receiver == "0000000000000000000000000000000000000000" { @@ -101,7 +101,7 @@ func NewJSTx(tx *ethchain.Transaction, state *ethstate.State) *JSTransaction { var data string if tx.CreatesContract() { - data = strings.Join(ethchain.Disassemble(tx.Data), "\n") + data = strings.Join(chain.Disassemble(tx.Data), "\n") } else { data = ethutil.Bytes2Hex(tx.Data) } @@ -150,7 +150,7 @@ func NewPReciept(contractCreation bool, creationAddress, hash, address []byte) * // Peer interface exposed to QML type JSPeer struct { - ref *ethchain.Peer + ref *chain.Peer Inbound bool `json:"isInbound"` LastSend int64 `json:"lastSend"` LastPong int64 `json:"lastPong"` @@ -162,7 +162,7 @@ type JSPeer struct { Caps string `json:"caps"` } -func NewJSPeer(peer ethchain.Peer) *JSPeer { +func NewJSPeer(peer chain.Peer) *JSPeer { if peer == nil { return nil } diff --git a/ethpipe/pipe.go b/ethpipe/pipe.go index 13085c887..7dd6ae262 100644 --- a/ethpipe/pipe.go +++ b/ethpipe/pipe.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/ethchain" + "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/ethcrypto" "github.com/ethereum/go-ethereum/ethlog" "github.com/ethereum/go-ethereum/ethstate" @@ -19,15 +19,15 @@ type VmVars struct { } type Pipe struct { - obj ethchain.EthManager - stateManager *ethchain.StateManager - blockChain *ethchain.ChainManager + obj chain.EthManager + stateManager *chain.StateManager + blockChain *chain.ChainManager world *World Vm VmVars } -func New(obj ethchain.EthManager) *Pipe { +func New(obj chain.EthManager) *Pipe { pipe := &Pipe{ obj: obj, stateManager: obj.StateManager(), @@ -68,7 +68,7 @@ func (self *Pipe) ExecuteObject(object *Object, data []byte, value, gas, price * return ret, err } -func (self *Pipe) Block(hash []byte) *ethchain.Block { +func (self *Pipe) Block(hash []byte) *chain.Block { return self.blockChain.GetBlock(hash) } @@ -111,7 +111,7 @@ func (self *Pipe) Transact(key *ethcrypto.KeyPair, rec []byte, value, gas, price contractCreation = true } - var tx *ethchain.Transaction + var tx *chain.Transaction // Compile and assemble the given data if contractCreation { script, err := ethutil.Compile(string(data), false) @@ -119,7 +119,7 @@ func (self *Pipe) Transact(key *ethcrypto.KeyPair, rec []byte, value, gas, price return nil, err } - tx = ethchain.NewContractCreationTx(value.BigInt(), gas.BigInt(), price.BigInt(), script) + tx = chain.NewContractCreationTx(value.BigInt(), gas.BigInt(), price.BigInt(), script) } else { data := ethutil.StringToByteFunc(string(data), func(s string) (ret []byte) { slice := strings.Split(s, "\n") @@ -130,7 +130,7 @@ func (self *Pipe) Transact(key *ethcrypto.KeyPair, rec []byte, value, gas, price return }) - tx = ethchain.NewTransactionMessage(hash, value.BigInt(), gas.BigInt(), price.BigInt(), data) + tx = chain.NewTransactionMessage(hash, value.BigInt(), gas.BigInt(), price.BigInt(), data) } acc := self.stateManager.TransState().GetOrNewStateObject(key.Address()) @@ -151,7 +151,7 @@ func (self *Pipe) Transact(key *ethcrypto.KeyPair, rec []byte, value, gas, price return tx.Hash(), nil } -func (self *Pipe) PushTx(tx *ethchain.Transaction) ([]byte, error) { +func (self *Pipe) PushTx(tx *chain.Transaction) ([]byte, error) { self.obj.TxPool().QueueTransaction(tx) if tx.Recipient == nil { addr := tx.CreationAddress(self.World().State()) diff --git a/ethpipe/vm_env.go b/ethpipe/vm_env.go index eb1190cf1..baab67b28 100644 --- a/ethpipe/vm_env.go +++ b/ethpipe/vm_env.go @@ -3,19 +3,19 @@ package ethpipe import ( "math/big" - "github.com/ethereum/go-ethereum/ethchain" + "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/vm" ) type VMEnv struct { state *ethstate.State - block *ethchain.Block + block *chain.Block value *big.Int sender []byte } -func NewEnv(state *ethstate.State, block *ethchain.Block, value *big.Int, sender []byte) *VMEnv { +func NewEnv(state *ethstate.State, block *chain.Block, value *big.Int, sender []byte) *VMEnv { return &VMEnv{ state: state, block: block, |