Skip to content

Commit 9e58b59

Browse files
committed
cache
1 parent b5f778f commit 9e58b59

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

govtool/backend/app/Main.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ startApp vvaConfig sentryService = do
125125
networkInfoCache <- newCache
126126
networkTotalStakeCache <- newCache
127127
dRepVotingPowerListCache <- newCache
128+
accountInfoCache <- newCache
128129
return $ CacheEnv
129130
{ proposalListCache
130131
, getProposalCache
@@ -139,6 +140,7 @@ startApp vvaConfig sentryService = do
139140
, networkInfoCache
140141
, networkTotalStakeCache
141142
, dRepVotingPowerListCache
143+
, accountInfoCache
142144
}
143145

144146
let connectionString = encodeUtf8 (dbSyncConnectionString $ getter vvaConfig)

govtool/backend/src/VVA/API.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ getNetworkMetrics = do
533533

534534
getAccountInfo :: App m => HexText -> m GetAccountInfoResponse
535535
getAccountInfo (unHexText -> stakeKey) = do
536-
-- CacheEnv {accountInfoCache} <- asks vvaCache
536+
CacheEnv {accountInfoCache} <- asks vvaCache
537537
Types.AccountInfo {..} <- Account.accountInfo stakeKey
538538
return $ GetAccountInfoResponse
539539
{ getAccountInfoResponseId = accountInfoId

govtool/backend/src/VVA/API/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ exampleGetAccountInfoResponse :: Text
10461046
exampleGetAccountInfoResponse =
10471047
"{\"stakeKey\": \"stake1u9\","
10481048
<> " \"id\": \"1\","
1049-
<> "\"view\": \"stake_test1uzapf83wydusjln97rqr7fen6vgrz5087yqdxm0akqdqkgstjz8g4\","
1049+
<> "\"view\": \"stake_test1uzapf83wydusjln97rqr7fen6vgrz5087yqdxm0akqdqkgstj2345\","
10501050
<> "\"isRegistered\": false,"
10511051
<> "\"isScriptBased\": false}"
10521052
instance ToSchema GetAccountInfoResponse where

govtool/backend/src/VVA/Types.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ data CacheEnv
260260
, networkInfoCache :: Cache.Cache () NetworkInfo
261261
, networkTotalStakeCache :: Cache.Cache () NetworkTotalStake
262262
, dRepVotingPowerListCache :: Cache.Cache Text [DRepVotingPowerList]
263+
, accountInfoCache :: Cache.Cache Text AccountInfo
263264
}
264265

265266
data NetworkInfo

0 commit comments

Comments
 (0)