From be977858562941ed8b8bd96eff65fbca1d1c4e4f Mon Sep 17 00:00:00 2001
From: Felix Lange <fjl@twurst.com>
Date: Tue, 6 Jan 2015 11:07:05 +0100
Subject: [PATCH] cmd/evm: add dummy implementation for GetHash

Fixes the build. AFAIK evm does not bother keeping a chain and
cannot provide a real implementation.
---
 cmd/evm/main.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cmd/evm/main.go b/cmd/evm/main.go
index 84ab0dc27..f902c99e5 100644
--- a/cmd/evm/main.go
+++ b/cmd/evm/main.go
@@ -131,6 +131,12 @@ func (self *VMEnv) Value() *big.Int       { return self.value }
 func (self *VMEnv) GasLimit() *big.Int    { return big.NewInt(1000000000) }
 func (self *VMEnv) Depth() int            { return 0 }
 func (self *VMEnv) SetDepth(i int)        { self.depth = i }
+func (self *VMEnv) GetHash(n uint64) []byte {
+	if self.block.Number().Cmp(big.NewInt(int64(n))) == 0 {
+		return self.block.Hash()
+	}
+	return nil
+}
 func (self *VMEnv) AddLog(log state.Log) {
 	self.state.AddLog(log)
 }
-- 
GitLab