events.go 2.1 KB
Newer Older
F
Felix Lange 已提交
1
// Copyright 2014 The go-ethereum Authors
2
// This file is part of the go-ethereum library.
F
Felix Lange 已提交
3
//
4
// The go-ethereum library is free software: you can redistribute it and/or modify
F
Felix Lange 已提交
5 6 7 8
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
9
// The go-ethereum library is distributed in the hope that it will be useful,
F
Felix Lange 已提交
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
F
Felix Lange 已提交
12 13 14
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
15
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
F
Felix Lange 已提交
16

O
obscuren 已提交
17
package core
18

O
obscuren 已提交
19
import (
20
	"github.com/ethereum/go-ethereum/common"
21
	"github.com/ethereum/go-ethereum/core/types"
O
obscuren 已提交
22
)
23

24
// TxPreEvent is posted when a transaction enters the transaction pool.
25
type TxPreEvent struct{ Tx *types.Transaction }
26

27
// TxPostEvent is posted when a transaction has been processed.
28
type TxPostEvent struct{ Tx *types.Transaction }
29

30 31
// PendingLogsEvent is posted pre mining and notifies of pending logs.
type PendingLogsEvent struct {
F
Felix Lange 已提交
32
	Logs []*types.Log
33 34
}

35 36 37
// PendingStateEvent is posted pre mining and notifies of pending state changes.
type PendingStateEvent struct{}

Z
zelig 已提交
38 39
// NewMinedBlockEvent is posted when a block has been imported.
type NewMinedBlockEvent struct{ Block *types.Block }
40

41 42 43
// RemovedTransactionEvent is posted when a reorg happens
type RemovedTransactionEvent struct{ Txs types.Transactions }

J
Jeffrey Wilcke 已提交
44
// RemovedLogEvent is posted when a reorg happens
F
Felix Lange 已提交
45
type RemovedLogsEvent struct{ Logs []*types.Log }
J
Jeffrey Wilcke 已提交
46

O
obscuren 已提交
47 48
type ChainEvent struct {
	Block *types.Block
49
	Hash  common.Hash
F
Felix Lange 已提交
50
	Logs  []*types.Log
O
obscuren 已提交
51 52 53 54 55 56 57 58
}

type ChainSideEvent struct {
	Block *types.Block
}

type PendingBlockEvent struct {
	Block *types.Block
F
Felix Lange 已提交
59
	Logs  []*types.Log
O
obscuren 已提交
60
}
61

O
obscuren 已提交
62 63 64 65
type ChainUncleEvent struct {
	Block *types.Block
}

66 67 68 69 70
type ChainHeadEvent struct{ Block *types.Block }

// Mining operation events
type StartMining struct{}
type TopMining struct{}