From 8f3a753eb570bf71faf214f52e39b989b998e944 Mon Sep 17 00:00:00 2001 From: Moritz Kiefer Date: Tue, 25 Jan 2022 21:22:20 +0100 Subject: [PATCH] Fix static-time config in Canton Slightly confusingly there are three different options that need to be set for this to actually work from a ledger API pov and with the port files option. changelog_begin changelog_end --- .../daml-helper/src/DA/Daml/Helper/Util.hs | 26 +++++++++++++------ .../src/DA/Daml/Assistant/IntegrationTests.hs | 4 +-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/daml-assistant/daml-helper/src/DA/Daml/Helper/Util.hs b/daml-assistant/daml-helper/src/DA/Daml/Helper/Util.hs index e16ea12a0004..7c8fe1cf9b06 100644 --- a/daml-assistant/daml-helper/src/DA/Daml/Helper/Util.hs +++ b/daml-assistant/daml-helper/src/DA/Daml/Helper/Util.hs @@ -289,17 +289,27 @@ cantonConfig CantonOptions{..} = ] ) , "participants" Aeson..= Aeson.object [ "sandbox" Aeson..= Aeson.object - [ storage - , "admin-api" Aeson..= port cantonAdminApi - , "ledger-api" Aeson..= port cantonLedgerApi - ] + ( + [ storage + , "admin-api" Aeson..= port cantonAdminApi + , "ledger-api" Aeson..= port cantonLedgerApi + ] <> + [ "testing-time" Aeson..= Aeson.object [ "type" Aeson..= ("monotonic-time" :: T.Text) ] + | StaticTime True <- [cantonStaticTime] + ] + ) ] , "domains" Aeson..= Aeson.object [ "local" Aeson..= Aeson.object - [ storage - , "public-api" Aeson..= port cantonDomainPublicApi - , "admin-api" Aeson..= port cantonDomainAdminApi - ] + ( + [ storage + , "public-api" Aeson..= port cantonDomainPublicApi + , "admin-api" Aeson..= port cantonDomainAdminApi + ] <> + [ "domain-parameters" Aeson..= Aeson.object [ "topology-change-delay" Aeson..= ("0 ms" :: T.Text) ] + | StaticTime True <- [cantonStaticTime] + ] + ) ] ] ] diff --git a/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs b/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs index d6b74c7ba07c..0bd2af921cd5 100644 --- a/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs +++ b/daml-assistant/integration-tests/src/DA/Daml/Assistant/IntegrationTests.hs @@ -195,9 +195,7 @@ quickSandbox projDir = do , "--domain-admin-port", show domainAdminApiPort , "--port-file", portFile , "--dar", darFile - -- , "--static-time" - -- TODO https://github.com/digital-asset/daml/issues/11831 - -- Re-enable once sim-clock is working. + , "--static-time" ]) {std_out = UseHandle devNull, create_group = True, cwd = Just projDir} (_, _, _, sandboxPh) <- createProcess sandboxProc