github.com/murrekatt/go-ethereum@v1.5.8-0.20170123175102-fc52f2c007fb/core/events.go (about) 1 // Copyright 2014 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // 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/>. 16 17 package core 18 19 import ( 20 "math/big" 21 22 "github.com/ethereum/go-ethereum/common" 23 "github.com/ethereum/go-ethereum/core/types" 24 ) 25 26 // TxPreEvent is posted when a transaction enters the transaction pool. 27 type TxPreEvent struct{ Tx *types.Transaction } 28 29 // TxPostEvent is posted when a transaction has been processed. 30 type TxPostEvent struct{ Tx *types.Transaction } 31 32 // PendingLogsEvent is posted pre mining and notifies of pending logs. 33 type PendingLogsEvent struct { 34 Logs []*types.Log 35 } 36 37 // PendingStateEvent is posted pre mining and notifies of pending state changes. 38 type PendingStateEvent struct{} 39 40 // NewMinedBlockEvent is posted when a block has been imported. 41 type NewMinedBlockEvent struct{ Block *types.Block } 42 43 // RemovedTransactionEvent is posted when a reorg happens 44 type RemovedTransactionEvent struct{ Txs types.Transactions } 45 46 // RemovedLogEvent is posted when a reorg happens 47 type RemovedLogsEvent struct{ Logs []*types.Log } 48 49 // ChainSplit is posted when a new head is detected 50 type ChainSplitEvent struct { 51 Block *types.Block 52 Logs []*types.Log 53 } 54 55 type ChainEvent struct { 56 Block *types.Block 57 Hash common.Hash 58 Logs []*types.Log 59 } 60 61 type ChainSideEvent struct { 62 Block *types.Block 63 } 64 65 type PendingBlockEvent struct { 66 Block *types.Block 67 Logs []*types.Log 68 } 69 70 type ChainUncleEvent struct { 71 Block *types.Block 72 } 73 74 type ChainHeadEvent struct{ Block *types.Block } 75 76 type GasPriceChanged struct{ Price *big.Int } 77 78 // Mining operation events 79 type StartMining struct{} 80 type TopMining struct{}