events.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package core
  2. import (
  3. "github.com/ethereum/go-ethereum/core/types"
  4. "github.com/ethereum/go-ethereum/state"
  5. )
  6. // TxPreEvent is posted when a transaction enters the transaction pool.
  7. type TxPreEvent struct{ Tx *types.Transaction }
  8. // TxPostEvent is posted when a transaction has been processed.
  9. type TxPostEvent struct{ Tx *types.Transaction }
  10. // NewBlockEvent is posted when a block has been imported.
  11. type NewBlockEvent struct{ Block *types.Block }
  12. // NewMinedBlockEvent is posted when a block has been imported.
  13. type NewMinedBlockEvent struct{ Block *types.Block }
  14. // ChainSplit is posted when a new head is detected
  15. type ChainSplitEvent struct {
  16. Block *types.Block
  17. Logs state.Logs
  18. }
  19. type ChainEvent struct {
  20. Block *types.Block
  21. Logs state.Logs
  22. }
  23. type ChainSideEvent struct {
  24. Block *types.Block
  25. Logs state.Logs
  26. }
  27. type PendingBlockEvent struct {
  28. Block *types.Block
  29. Logs state.Logs
  30. }
  31. type ChainHeadEvent struct{ Block *types.Block }
  32. // Mining operation events
  33. type StartMining struct{}
  34. type TopMining struct{}