Skip to content

Commit

Permalink
Merge pull request #261 from dapperlabs/judez/add-new-destroy-event
Browse files Browse the repository at this point in the history
Add new destroy event name
  • Loading branch information
judezhu authored Aug 17, 2024
2 parents 0f9969b + f32c479 commit b39c50b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/go/events/moment_destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

const (
EventMomentDestroyed = "TopShot.MomentDestroyed"
EventMomentDestroyed = "TopShot.MomentDestroyed"
EventMomentDestroyedV2 = "TopShot.NFT.ResourceDestroyed"
)

type MomentDestroyedEvent interface {
Expand All @@ -24,7 +25,7 @@ func DecodeMomentDestroyedEvent(b []byte) (MomentDestroyedEvent, error) {
if err != nil {
return nil, err
}
if cadenceValue.EventType.QualifiedIdentifier != EventMomentDestroyed {
if cadenceValue.EventType.QualifiedIdentifier != EventMomentDestroyed && cadenceValue.EventType.QualifiedIdentifier != EventMomentDestroyedV2 {
return nil, fmt.Errorf("unexpected event type: %s", cadenceValue.EventType.QualifiedIdentifier)
}
eventMap, err := decoder.ConvertEvent(cadenceValue)
Expand Down

0 comments on commit b39c50b

Please sign in to comment.