diff --git a/app/cache/memory_store.go b/app/cache/memory_store.go index 0dbc1be..a198a70 100644 --- a/app/cache/memory_store.go +++ b/app/cache/memory_store.go @@ -7,10 +7,15 @@ import ( "time" ) +// Store time function in a variable. +// Makes it easy to travel in time when testing. var now = time.Now type memoryStoreItem struct { - value any + // Actual value stored. + value any + + // Cache expiration time. expired time.Time } diff --git a/app/cache/store.go b/app/cache/store.go index 1b69639..a9d85e8 100644 --- a/app/cache/store.go +++ b/app/cache/store.go @@ -5,6 +5,7 @@ import ( "time" ) +// Interface to a cache storage. type Store interface { // Set an item in the store. Set(ctx context.Context, key string, value any, TTL time.Duration) error diff --git a/app/ship_processor.go b/app/ship_processor.go index 1f0abf1..b750cb5 100644 --- a/app/ship_processor.go +++ b/app/ship_processor.go @@ -74,7 +74,7 @@ func SpawnProccessor(shipStream *shipclient.Stream, loader StateLoader, saver St shipStream.BlockHandler = processor.processBlock shipStream.InitHandler = processor.initHandler - // Needed because if nil, traces will not be included in the response from ship. + // Needed because if nil, traces/table deltas will not be included in the response from ship. shipStream.TraceHandler = func([]*ship.TransactionTraceV0) {} shipStream.TableDeltaHandler = func([]*ship.TableDeltaV0) {}