Add EventsRoot field to message receipt
This commit is contained in:
parent
c9c53c9745
commit
85df74ff43
24
chain/types/event.go
Normal file
24
chain/types/event.go
Normal file
@ -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
|
||||
}
|
@ -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
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ func main() {
|
||||
types.BeaconEntry{},
|
||||
types.StateRoot{},
|
||||
types.StateInfo0{},
|
||||
types.Event{},
|
||||
types.EventEntry{},
|
||||
)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
Loading…
Reference in New Issue
Block a user