aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-08-25 21:49:36 +0800
committerFelix Lange <fjl@twurst.com>2015-08-25 21:49:36 +0800
commitabce09954b6901b446c004ee06b389c338922f28 (patch)
tree16ddada3b6ecbf26e53bb9eaf0c8b03812f7cab8 /core/vm
parenta219159e7e18ccaa52c9c493a19a11e6b7bab3dd (diff)
parent7324176f702a77fc331bf16a968d2eb4bccce021 (diff)
downloadgo-tangerine-abce09954b6901b446c004ee06b389c338922f28.tar
go-tangerine-abce09954b6901b446c004ee06b389c338922f28.tar.gz
go-tangerine-abce09954b6901b446c004ee06b389c338922f28.tar.bz2
go-tangerine-abce09954b6901b446c004ee06b389c338922f28.tar.lz
go-tangerine-abce09954b6901b446c004ee06b389c338922f28.tar.xz
go-tangerine-abce09954b6901b446c004ee06b389c338922f28.tar.zst
go-tangerine-abce09954b6901b446c004ee06b389c338922f28.zip
Merge pull request #1711 from Gustav-Simonsson/timestamp_big_int
Add tests for uncle timestamps and refactor timestamp type
Diffstat (limited to 'core/vm')
-rw-r--r--core/vm/environment.go2
-rw-r--r--core/vm/instructions.go2
-rw-r--r--core/vm/jit_test.go2
-rw-r--r--core/vm/vm.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/core/vm/environment.go b/core/vm/environment.go
index 5a1bf3201..916081f51 100644
--- a/core/vm/environment.go
+++ b/core/vm/environment.go
@@ -33,7 +33,7 @@ type Environment interface {
BlockNumber() *big.Int
GetHash(n uint64) common.Hash
Coinbase() common.Address
- Time() uint64
+ Time() *big.Int
Difficulty() *big.Int
GasLimit() *big.Int
CanTransfer(from Account, balance *big.Int) bool
diff --git a/core/vm/instructions.go b/core/vm/instructions.go
index 2de35a443..aa0117cc8 100644
--- a/core/vm/instructions.go
+++ b/core/vm/instructions.go
@@ -341,7 +341,7 @@ func opCoinbase(instr instruction, env Environment, context *Context, memory *Me
}
func opTimestamp(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) {
- stack.push(U256(new(big.Int).SetUint64(env.Time())))
+ stack.push(U256(new(big.Int).Set(env.Time())))
}
func opNumber(instr instruction, env Environment, context *Context, memory *Memory, stack *stack) {
diff --git a/core/vm/jit_test.go b/core/vm/jit_test.go
index b9e2c6999..d8e442637 100644
--- a/core/vm/jit_test.go
+++ b/core/vm/jit_test.go
@@ -93,7 +93,7 @@ func (self *Env) StructLogs() []StructLog {
//func (self *Env) PrevHash() []byte { return self.parent }
func (self *Env) Coinbase() common.Address { return common.Address{} }
-func (self *Env) Time() uint64 { return uint64(time.Now().Unix()) }
+func (self *Env) Time() *big.Int { return big.NewInt(time.Now().Unix()) }
func (self *Env) Difficulty() *big.Int { return big.NewInt(0) }
func (self *Env) State() *state.StateDB { return nil }
func (self *Env) GasLimit() *big.Int { return self.gasLimit }
diff --git a/core/vm/vm.go b/core/vm/vm.go
index da764004a..d9e1a0ce5 100644
--- a/core/vm/vm.go
+++ b/core/vm/vm.go
@@ -491,7 +491,7 @@ func (self *Vm) Run(context *Context, input []byte) (ret []byte, err error) {
case TIMESTAMP:
time := self.env.Time()
- stack.push(new(big.Int).SetUint64(time))
+ stack.push(new(big.Int).Set(time))
case NUMBER:
number := self.env.BlockNumber()