diff --git a/chain/types/event.go b/chain/types/event.go new file mode 100644 index 000000000..dc681d935 --- /dev/null +++ b/chain/types/event.go @@ -0,0 +1,24 @@ +package types + +import ( + "github.com/filecoin-project/go-address" +) + +type Event struct { + // The ID of the actor that emitted this event. + Emitter address.Address + + // Key values making up this event. + Entries []EventEntry +} + +type EventEntry struct { + // A bitmap conveying metadata or hints about this entry. + Flags uint8 + + // The key of this event entry + Key []byte + + // Any DAG-CBOR encodeable type. + Value []byte +} diff --git a/chain/types/message_receipt.go b/chain/types/message_receipt.go index 57761680d..990858d5f 100644 --- a/chain/types/message_receipt.go +++ b/chain/types/message_receipt.go @@ -3,15 +3,18 @@ package types import ( "bytes" + "github.com/ipfs/go-cid" + "github.com/filecoin-project/go-state-types/exitcode" ) type MessageReceipt struct { - ExitCode exitcode.ExitCode - Return []byte - GasUsed int64 + ExitCode exitcode.ExitCode + Return []byte + GasUsed int64 + EventsRoot cid.Cid // Root of Event AMT } func (mr *MessageReceipt) Equals(o *MessageReceipt) bool { - return mr.ExitCode == o.ExitCode && bytes.Equal(mr.Return, o.Return) && mr.GasUsed == o.GasUsed + return mr.ExitCode == o.ExitCode && bytes.Equal(mr.Return, o.Return) && mr.GasUsed == o.GasUsed && mr.EventsRoot == o.EventsRoot } diff --git a/gen/main.go b/gen/main.go index 95b2d43e3..125db293e 100644 --- a/gen/main.go +++ b/gen/main.go @@ -34,6 +34,8 @@ func main() { types.BeaconEntry{}, types.StateRoot{}, types.StateInfo0{}, + types.Event{}, + types.EventEntry{}, ) if err != nil { fmt.Println(err)