@@ -512,7 +512,9 @@ is2xx = \case
512
512
Right res -> pure res
513
513
514
514
getStateCert' :: (HasCallStack , HasAgentConfig ) => Blob -> Blob -> [[Blob ]] -> IO (HTTPErrOr Certificate )
515
- getStateCert' = getStateCert'' endPoint
515
+ getStateCert' sender ecid paths = do
516
+ void $ sync_height ecid
517
+ getStateCert'' endPoint sender ecid paths
516
518
517
519
decodeCert' :: HasCallStack => Blob -> IO Certificate
518
520
decodeCert' b = either (assertFailure . T. unpack) return $ decodeCert b
@@ -540,7 +542,7 @@ getStateCert'' ep sender ecid paths = do
540
542
return $ Right cert
541
543
542
544
getStateCert :: (HasCallStack , HasAgentConfig ) => Blob -> Blob -> [[Blob ]] -> IO Certificate
543
- getStateCert sender ecid paths = getStateCert'' endPoint sender ecid paths >>= is2xx
545
+ getStateCert sender ecid paths = getStateCert' sender ecid paths >>= is2xx
544
546
545
547
extractCertData :: Blob -> Blob -> IO Blob
546
548
extractCertData cid b = do
@@ -624,7 +626,7 @@ certValueAbsent cert path = case lookupPath (cert_tree cert) path of
624
626
625
627
getRequestStatus' :: (HasCallStack , HasAgentConfig ) => Blob -> Blob -> Blob -> IO (HTTPErrOr ReqStatus )
626
628
getRequestStatus' sender cid rid = do
627
- response <- getStateCert'' endPoint sender cid [[" request_status" , rid]]
629
+ response <- getStateCert' sender cid [[" request_status" , rid]]
628
630
case response of
629
631
Left x -> return $ Left x
630
632
Right cert -> do
0 commit comments