aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/pipe.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-18 23:58:22 +0800
committerobscuren <geffobscura@gmail.com>2014-11-18 23:58:22 +0800
commita1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b (patch)
treeaee891c8f02591e16377a6bf047c13f12d6d5123 /xeth/pipe.go
parent62cd9946ee16758a4e368cd0b5a0ba9fa4d94705 (diff)
downloadgo-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.gz
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.zst
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.zip
Begin of moving objects to types package
* Block(s) * Transaction(s)
Diffstat (limited to 'xeth/pipe.go')
-rw-r--r--xeth/pipe.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/xeth/pipe.go b/xeth/pipe.go
index abed8ef9a..8130ab72e 100644
--- a/xeth/pipe.go
+++ b/xeth/pipe.go
@@ -9,6 +9,7 @@ import (
"strings"
"github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
@@ -72,7 +73,7 @@ func (self *XEth) ExecuteObject(object *Object, data []byte, value, gas, price *
return ret, err
}
-func (self *XEth) Block(hash []byte) *chain.Block {
+func (self *XEth) Block(hash []byte) *types.Block {
return self.blockChain.GetBlock(hash)
}
@@ -115,7 +116,7 @@ func (self *XEth) Transact(key *crypto.KeyPair, rec []byte, value, gas, price *e
contractCreation = true
}
- var tx *chain.Transaction
+ var tx *types.Transaction
// Compile and assemble the given data
if contractCreation {
script, err := ethutil.Compile(string(data), false)
@@ -123,7 +124,7 @@ func (self *XEth) Transact(key *crypto.KeyPair, rec []byte, value, gas, price *e
return nil, err
}
- tx = chain.NewContractCreationTx(value.BigInt(), gas.BigInt(), price.BigInt(), script)
+ tx = types.NewContractCreationTx(value.BigInt(), gas.BigInt(), price.BigInt(), script)
} else {
data := ethutil.StringToByteFunc(string(data), func(s string) (ret []byte) {
slice := strings.Split(s, "\n")
@@ -134,7 +135,7 @@ func (self *XEth) Transact(key *crypto.KeyPair, rec []byte, value, gas, price *e
return
})
- tx = chain.NewTransactionMessage(hash, value.BigInt(), gas.BigInt(), price.BigInt(), data)
+ tx = types.NewTransactionMessage(hash, value.BigInt(), gas.BigInt(), price.BigInt(), data)
}
acc := self.blockManager.TransState().GetOrNewStateObject(key.Address())
@@ -155,7 +156,7 @@ func (self *XEth) Transact(key *crypto.KeyPair, rec []byte, value, gas, price *e
return tx.Hash(), nil
}
-func (self *XEth) PushTx(tx *chain.Transaction) ([]byte, error) {
+func (self *XEth) PushTx(tx *types.Transaction) ([]byte, error) {
self.obj.TxPool().QueueTransaction(tx)
if tx.Recipient == nil {
addr := tx.CreationAddress(self.World().State())