Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed Nov 5, 2024
1 parent 3633229 commit 9c2531f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class DynamoRouteCachingProvider extends IRouteCachingProvider {
): CachedRoutes {
metric.putMetric(`RoutesDbEntriesFound`, result.Items!.length, MetricLoggerUnit.Count)
const cachedRoutesArr: CachedRoutes[] = result.Items!.map((record) => {
if (record.plainRoutes?.toString().trim() !== '') {
if (record.plainRoutes && record.plainRoutes?.toString().trim() !== '') {
metric.putMetric(`RoutesDbEntryPlainTextRouteFound`, 1, MetricLoggerUnit.Count)

const cachedRoutesJson = JSON.parse(record.plainRoutes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ describe('DynamoRouteCachingProvider', async () => {

it('Cached routes hits new cached routes lambda', async () => {
spy.withArgs('CachingQuoteForRoutesDbRequestSentToLambdanewcachinglambda', 1, MetricLoggerUnit.Count)
spy.withArgs('RoutesDbEntryPlainTextRouteFound', 1, MetricLoggerUnit.Count)

// testnet rolls out at 100%
const newCachedRoutesRolloutPercent = NEW_CACHED_ROUTES_ROLLOUT_PERCENT[ChainId.SEPOLIA]
Expand Down

0 comments on commit 9c2531f

Please sign in to comment.