Skip to content

Commit

Permalink
fix: correct Value() for feed
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Jan 17, 2025
1 parent 950f2ce commit a897bc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/gno.land/p/demo/gnorkle/feeds/periodic/feed.gno
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ func (f *Feed) Ingest(funcType message.FuncType, msg, providerAddress string) er
// Value returns the feed's latest value, it's data type, and whether or not it can
// be safely consumed. In this case it can be consumed because it's a periodic feed.
func (f Feed) Value() (feed.Value, string, bool) {
return f.storage.GetLatest(), f.valueDataType, false
lastValue := f.storage.GetLatest()
return lastValue, f.valueDataType, lastValue == feed.Value{}
}

// MarshalJSON marshals the components of the feed that are needed for
Expand Down

0 comments on commit a897bc9

Please sign in to comment.