Skip to content

Commit

Permalink
fix default timestamp for not_in_current_feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Nov 29, 2024
1 parent c5b601e commit ed88902
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions x/feeds/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (suite *KeeperTestSuite) TestQueryPrice() {
Status: types.PRICE_STATUS_NOT_IN_CURRENT_FEEDS,
SignalID: "CS:ATOM-USD",
Price: 0,
Timestamp: 0,
Timestamp: suite.ctx.BlockTime().Unix(),
},
}, res)
}
Expand Down Expand Up @@ -120,7 +120,7 @@ func (suite *KeeperTestSuite) TestQueryPrices() {
SignalID: "CS:NON-EXISTENT",
Status: types.PRICE_STATUS_NOT_IN_CURRENT_FEEDS,
Price: 0,
Timestamp: 0,
Timestamp: suite.ctx.BlockTime().Unix(),
},
},
},
Expand All @@ -138,7 +138,12 @@ func (suite *KeeperTestSuite) TestQueryPrices() {
signalIDs: []string{"CS:BAND-USD", "CS:NON-EXISTENT"},
expectedPrices: []types.Price{
prices[0],
{SignalID: "CS:NON-EXISTENT", Status: types.PRICE_STATUS_NOT_IN_CURRENT_FEEDS, Price: 0, Timestamp: 0},
{
SignalID: "CS:NON-EXISTENT",
Status: types.PRICE_STATUS_NOT_IN_CURRENT_FEEDS,
Price: 0,
Timestamp: suite.ctx.BlockTime().Unix(),
},
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion x/feeds/keeper/keeper_price.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (k Keeper) GetPrice(ctx sdk.Context, signalID string) types.Price {
SignalID: signalID,
Status: types.PRICE_STATUS_NOT_IN_CURRENT_FEEDS,
Price: 0,
Timestamp: 0,
Timestamp: ctx.BlockTime().Unix(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion x/feeds/keeper/keeper_price_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (suite *KeeperTestSuite) TestGetSetDeletePrices() {
SignalID: "CS:ETH-USD",
Status: types.PRICE_STATUS_NOT_IN_CURRENT_FEEDS,
Price: 0,
Timestamp: 0,
Timestamp: suite.ctx.BlockTime().Unix(),
})
prices = suite.feedsKeeper.GetPrices(ctx, []string{"CS:ATOM-USD", "CS:BAND-USD", "CS:ETH-USD"})
suite.Require().Equal(expPrices, prices)
Expand Down

0 comments on commit ed88902

Please sign in to comment.