github.com/ethereumproject/go-ethereum@v5.5.2+incompatible/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  	"time"
    23  
    24  	"github.com/ethereumproject/go-ethereum/common"
    25  	"github.com/ethereumproject/go-ethereum/core/types"
    26  	"github.com/ethereumproject/go-ethereum/core/vm"
    27  )
    28  
    29  // TxPreEvent is posted when a transaction enters the transaction pool.
    30  type TxPreEvent struct{ Tx *types.Transaction }
    31  
    32  // TxPostEvent is posted when a transaction has been processed.
    33  type TxPostEvent struct{ Tx *types.Transaction }
    34  
    35  // PendingLogsEvent is posted pre mining and notifies of pending logs.
    36  type PendingLogsEvent struct {
    37  	Logs vm.Logs
    38  }
    39  
    40  // PendingStateEvent is posted pre mining and notifies of pending state changes.
    41  type PendingStateEvent struct{}
    42  
    43  // NewBlockEvent is posted when a block has been imported.
    44  type NewBlockEvent struct{ Block *types.Block }
    45  
    46  // NewMinedBlockEvent is posted when a block has been imported.
    47  type NewMinedBlockEvent struct{ Block *types.Block }
    48  
    49  // RemovedTransactionEvent is posted when a reorg happens
    50  type RemovedTransactionEvent struct{ Txs types.Transactions }
    51  
    52  // RemovedLogEvent is posted when a reorg happens
    53  type RemovedLogsEvent struct{ Logs vm.Logs }
    54  
    55  // ChainSplit is posted when a new head is detected
    56  type ChainSplitEvent struct {
    57  	Block *types.Block
    58  	Logs  vm.Logs
    59  }
    60  
    61  type ChainEvent struct {
    62  	Block *types.Block
    63  	Hash  common.Hash
    64  	Logs  vm.Logs
    65  }
    66  
    67  type ChainSideEvent struct {
    68  	Block *types.Block
    69  	Logs  vm.Logs
    70  }
    71  
    72  // TODO: no usages found in project files
    73  type PendingBlockEvent struct {
    74  	Block *types.Block
    75  	Logs  vm.Logs
    76  }
    77  
    78  type ChainInsertEvent struct {
    79  	Processed       int
    80  	Queued          int
    81  	Ignored         int
    82  	TxCount         int
    83  	LastNumber      uint64
    84  	LastHash        common.Hash
    85  	Elasped         time.Duration
    86  	LatestBlockTime time.Time
    87  }
    88  
    89  type ReceiptChainInsertEvent struct {
    90  	Processed         int
    91  	Ignored           int
    92  	FirstNumber       uint64
    93  	FirstHash         common.Hash
    94  	LastNumber        uint64
    95  	LastHash          common.Hash
    96  	Elasped           time.Duration
    97  	LatestReceiptTime time.Time
    98  }
    99  
   100  type HeaderChainInsertEvent struct {
   101  	Processed  int
   102  	Ignored    int
   103  	LastNumber uint64
   104  	LastHash   common.Hash
   105  	Elasped    time.Duration
   106  }
   107  
   108  // TODO: no usages found in project files
   109  type ChainUncleEvent struct {
   110  	Block *types.Block
   111  }
   112  
   113  type ChainHeadEvent struct{ Block *types.Block }
   114  
   115  type GasPriceChanged struct{ Price *big.Int }
   116  
   117  // Mining operation events
   118  type StartMining struct{}
   119  type StopMining struct{}