github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/fvm/environment/event_encoder.go (about)

     1  package environment
     2  
     3  import (
     4  	"github.com/onflow/cadence"
     5  	"github.com/onflow/cadence/encoding/ccf"
     6  )
     7  
     8  type EventEncoder interface {
     9  	Encode(event cadence.Event) ([]byte, error)
    10  }
    11  
    12  type CadenceEventEncoder struct{}
    13  
    14  func NewCadenceEventEncoder() *CadenceEventEncoder {
    15  	return &CadenceEventEncoder{}
    16  }
    17  
    18  func (e *CadenceEventEncoder) Encode(event cadence.Event) ([]byte, error) {
    19  	return ccf.Encode(event)
    20  }