-
Notifications
You must be signed in to change notification settings - Fork 6
/
log.go
34 lines (26 loc) · 1008 Bytes
/
log.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package model
import (
"github.com/33cn/chain33/common/log/log15"
"github.com/aBitcoinDiamond/slave/executor/evm/executor/vm/common"
)
// ContractLog 合约在日志,对应EVM中的Log指令,可以生成指定的日志信息
// 目前这些日志只是在合约执行完成时进行打印,没有其它用途
type ContractLog struct {
// Address 合约地址
Address common.Address
// TxHash 对应交易哈希
TxHash common.Hash
// Index 日志序号
Index int
// Topics 此合约提供的主题信息
Topics []common.Hash
// Data 日志数据
Data []byte
}
// PrintLog 合约日志打印格式
func (log *ContractLog) PrintLog() {
log15.Debug("!Contract Log!", "Contract address", log.Address.String(), "TxHash", log.TxHash.Hex(), "Log Index", log.Index, "Log Topics", log.Topics, "Log Data", common.Bytes2Hex(log.Data))
}