aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm_env.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-06-10 18:23:49 +0800
committerobscuren <geffobscura@gmail.com>2015-06-10 18:23:49 +0800
commit38c61f6f2567e7943c9a16e2be0a2bfedb3a1fb3 (patch)
tree3877af08004f9dc2de00001257c9fe678de049d1 /core/vm_env.go
parentff5b3ef0877978699235d20b3caa9890b35ec6f8 (diff)
downloadgo-tangerine-38c61f6f2567e7943c9a16e2be0a2bfedb3a1fb3.tar.gz
go-tangerine-38c61f6f2567e7943c9a16e2be0a2bfedb3a1fb3.tar.zst
go-tangerine-38c61f6f2567e7943c9a16e2be0a2bfedb3a1fb3.zip
core, core/vm: added structure logging
This also reduces the time required spend in the VM
Diffstat (limited to 'core/vm_env.go')
-rw-r--r--core/vm_env.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/vm_env.go b/core/vm_env.go
index c439d2946..da862d5c8 100644
--- a/core/vm_env.go
+++ b/core/vm_env.go
@@ -16,6 +16,8 @@ type VMEnv struct {
depth int
chain *ChainManager
typ vm.Type
+ // structured logging
+ logs []vm.StructLog
}
func NewEnv(state *state.StateDB, chain *ChainManager, msg Message, block *types.Block) *VMEnv {
@@ -47,6 +49,7 @@ func (self *VMEnv) GetHash(n uint64) common.Hash {
return common.Hash{}
}
+
func (self *VMEnv) AddLog(log *state.Log) {
self.state.AddLog(log)
}
@@ -68,3 +71,11 @@ func (self *VMEnv) Create(me vm.ContextRef, data []byte, gas, price, value *big.
exe := NewExecution(self, nil, data, gas, price, value)
return exe.Create(me)
}
+
+func (self *VMEnv) StructLogs() []vm.StructLog {
+ return self.logs
+}
+
+func (self *VMEnv) AddStructLog(log vm.StructLog) {
+ self.logs = append(self.logs, log)
+}