github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/tm2/pkg/bft/types/events.go (about)

     1  package types
     2  
     3  import (
     4  	abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types"
     5  	"github.com/gnolang/gno/tm2/pkg/events"
     6  )
     7  
     8  // TMEvent implements events.Event.
     9  type TMEvent interface {
    10  	events.Event
    11  }
    12  
    13  func (EventNewBlock) AssertEvent()            {}
    14  func (EventNewBlockHeader) AssertEvent()      {}
    15  func (EventTx) AssertEvent()                  {}
    16  func (EventVote) AssertEvent()                {}
    17  func (EventString) AssertEvent()              {}
    18  func (EventValidatorSetUpdates) AssertEvent() {}
    19  
    20  // Most event messages are basic types (a block, a transaction)
    21  // but some (an input to a call tx or a receive) are more exotic
    22  
    23  type EventNewBlock struct {
    24  	Block *Block `json:"block"`
    25  
    26  	ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"`
    27  	ResultEndBlock   abci.ResponseEndBlock   `json:"result_end_block"`
    28  }
    29  
    30  // light weight event for benchmarking
    31  type EventNewBlockHeader struct {
    32  	Header Header `json:"header"`
    33  
    34  	ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"`
    35  	ResultEndBlock   abci.ResponseEndBlock   `json:"result_end_block"`
    36  }
    37  
    38  // All txs fire EventTx
    39  type EventTx struct {
    40  	Result TxResult `json:"result"`
    41  }
    42  
    43  type EventVote struct {
    44  	Vote *Vote `json:"vote"`
    45  }
    46  
    47  type EventString string
    48  
    49  type EventValidatorSetUpdates struct {
    50  	ValidatorUpdates []abci.ValidatorUpdate `json:"validator_updates"`
    51  }