aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/instructions.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-01-05 21:03:50 +0800
committerFelix Lange <fjl@twurst.com>2017-01-06 21:15:22 +0800
commit7731061903bb992f7630ab389863951efb360258 (patch)
treeea706da87ce002a631cba30b171cb44dbdd7c2c6 /core/vm/instructions.go
parentb9683d3748dcb73ab5a5474334eaf157267d9c4a (diff)
downloadgo-tangerine-7731061903bb992f7630ab389863951efb360258.tar.gz
go-tangerine-7731061903bb992f7630ab389863951efb360258.tar.zst
go-tangerine-7731061903bb992f7630ab389863951efb360258.zip
core/vm: move Log to core/types
This significantly reduces the dependency closure of ethclient, which no longer depends on core/vm as of this change. All uses of vm.Logs are replaced by []*types.Log. NewLog is gone too, the constructor simply returned a literal.
Diffstat (limited to 'core/vm/instructions.go')
-rw-r--r--core/vm/instructions.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/vm/instructions.go b/core/vm/instructions.go
index 2839b7109..5bfa73a30 100644
--- a/core/vm/instructions.go
+++ b/core/vm/instructions.go
@@ -22,6 +22,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params"
)
@@ -605,8 +606,14 @@ func makeLog(size int) executionFunc {
}
d := memory.Get(mStart.Int64(), mSize.Int64())
- log := NewLog(contract.Address(), topics, d, env.BlockNumber.Uint64())
- env.StateDB.AddLog(log)
+ env.StateDB.AddLog(&types.Log{
+ Address: contract.Address(),
+ Topics: topics,
+ Data: d,
+ // This is a non-consensus field, but assigned here because
+ // core/state doesn't know the current block number.
+ BlockNumber: env.BlockNumber.Uint64(),
+ })
return nil, nil
}
}