aboutsummaryrefslogtreecommitdiffstats
path: root/core/state_transition.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-16 18:27:38 +0800
committerobscuren <geffobscura@gmail.com>2015-03-16 18:27:38 +0800
commitb5234413611ce5984292f85a01de1f56c045b490 (patch)
treee6e0c6f7fe8358a2dc63cdea11ac66b4f59397f5 /core/state_transition.go
parent0b8f66ed9ef177dc72442dd7ba337c6733e30344 (diff)
downloadgo-tangerine-b5234413611ce5984292f85a01de1f56c045b490.tar
go-tangerine-b5234413611ce5984292f85a01de1f56c045b490.tar.gz
go-tangerine-b5234413611ce5984292f85a01de1f56c045b490.tar.bz2
go-tangerine-b5234413611ce5984292f85a01de1f56c045b490.tar.lz
go-tangerine-b5234413611ce5984292f85a01de1f56c045b490.tar.xz
go-tangerine-b5234413611ce5984292f85a01de1f56c045b490.tar.zst
go-tangerine-b5234413611ce5984292f85a01de1f56c045b490.zip
Moved ethutil => common
Diffstat (limited to 'core/state_transition.go')
-rw-r--r--core/state_transition.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/state_transition.go b/core/state_transition.go
index f49aed874..279abee62 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -5,7 +5,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
@@ -58,7 +58,7 @@ type Message interface {
func AddressFromMessage(msg Message) []byte {
// Generate a new address
- return crypto.Sha3(ethutil.NewValue([]interface{}{msg.From(), msg.Nonce()}).Encode())[12:]
+ return crypto.Sha3(common.NewValue([]interface{}{msg.From(), msg.Nonce()}).Encode())[12:]
}
func MessageCreatesContract(msg Message) bool {
@@ -226,9 +226,9 @@ func (self *StateTransition) refundGas() {
remaining := new(big.Int).Mul(self.gas, self.msg.GasPrice())
sender.AddBalance(remaining)
- uhalf := new(big.Int).Div(self.gasUsed(), ethutil.Big2)
+ uhalf := new(big.Int).Div(self.gasUsed(), common.Big2)
for addr, ref := range self.state.Refunds() {
- refund := ethutil.BigMin(uhalf, ref)
+ refund := common.BigMin(uhalf, ref)
self.gas.Add(self.gas, refund)
self.state.AddBalance([]byte(addr), refund.Mul(refund, self.msg.GasPrice()))
}