events.go 1.2 KB

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