good morning!!!!

Skip to content
Snippets Groups Projects
Commit 5871dbaf authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Set contract addr for new transactions

parent b0e023e4
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ type Transaction struct { ...@@ -25,7 +25,7 @@ type Transaction struct {
} }
func NewContractCreationTx(value, gas, gasPrice *big.Int, script []byte) *Transaction { func NewContractCreationTx(value, gas, gasPrice *big.Int, script []byte) *Transaction {
return &Transaction{Value: value, Gas: gas, GasPrice: gasPrice, Data: script, contractCreation: true} return &Transaction{Recipient: ContractAddr, Value: value, Gas: gas, GasPrice: gasPrice, Data: script, contractCreation: true}
} }
func NewTransactionMessage(to []byte, value, gas, gasPrice *big.Int, data []byte) *Transaction { func NewTransactionMessage(to []byte, value, gas, gasPrice *big.Int, data []byte) *Transaction {
......
...@@ -111,11 +111,12 @@ func NewPTx(tx *ethchain.Transaction) *PTx { ...@@ -111,11 +111,12 @@ func NewPTx(tx *ethchain.Transaction) *PTx {
sender := hex.EncodeToString(tx.Sender()) sender := hex.EncodeToString(tx.Sender())
createsContract := tx.CreatesContract() createsContract := tx.CreatesContract()
data := strings.Join(ethchain.Disassemble(tx.Data), "\n") data := string(tx.Data)
if tx.CreatesContract() {
isContract := len(tx.Data) > 0 data = strings.Join(ethchain.Disassemble(tx.Data), "\n")
}
return &PTx{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: receiver, Contract: isContract, Gas: tx.Gas.String(), GasPrice: tx.GasPrice.String(), Data: data, Sender: sender, CreatesContract: createsContract, RawData: hex.EncodeToString(tx.Data)} return &PTx{ref: tx, Hash: hash, Value: ethutil.CurrencyToString(tx.Value), Address: receiver, Contract: tx.CreatesContract(), Gas: tx.Gas.String(), GasPrice: tx.GasPrice.String(), Data: data, Sender: sender, CreatesContract: createsContract, RawData: hex.EncodeToString(tx.Data)}
} }
func (self *PTx) ToString() string { func (self *PTx) ToString() string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment