github.com/koko1123/flow-go-1@v0.29.6/fvm/environment/event_encoder.go (about)

     1  package environment
     2  
     3  import (
     4  	"github.com/onflow/cadence"
     5  	jsoncdc "github.com/onflow/cadence/encoding/json"
     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 jsoncdc.Encode(event)
    20  }