From 9db2c148ad45005c648d375a000f35e72dba48e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Fri, 23 Aug 2024 16:37:59 +0200 Subject: [PATCH] create-testnet-data: take default value of --total-supply from shelley genesis + default delegated supply to half the total supply (no default anymore) --- cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs | 6 ++---- .../Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs index 87fa312377..f180628a8b 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs @@ -328,10 +328,9 @@ pGenesisCreateTestNetData sbe envCli = , Opt.metavar "LOVELACE" , Opt.help $ mconcat - [ "The maximum possible amount of Lovelace, which is evenly distributed across stake holders. Defaults to 1 million Ada (i.e. 10^12 Lovelace)." + [ "The maximum possible amount of Lovelace, which is evenly distributed across stake holders. Overrides the value from the shelley genesis." , " If --delegated-supply is specified, a part of this amount will be delegated." ] - , Opt.value 1_000_000_000_000 ] pSupplyDelegated :: Parser (Maybe Coin) pSupplyDelegated = @@ -343,10 +342,9 @@ pGenesisCreateTestNetData sbe envCli = , Opt.metavar "LOVELACE" , Opt.help $ mconcat - [ "The amount of the total supply which is evenly delegated. Defaults to 500 000 Ada (i.e. (10^12) / 2 Lovelace)." + [ "The amount of the total supply which is evenly delegated. Defaulted to half of the total supply." , " Cannot be more than the amount specified with --total-supply." ] - , Opt.value 500_000_000_000 ] pRelays :: Parser FilePath pRelays = diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs index 98973134de..763710cd4e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs @@ -738,7 +738,7 @@ updateOutputTemplate totalSupply = fromIntegral $ maybe maximumLovelaceSupply unLovelace mTotalSupply delegCoinRaw, nonDelegCoinRaw :: Integer - delegCoinRaw = maybe 0 unLovelace mDelegatedSupply + delegCoinRaw = maybe (totalSupply `div` 2) unLovelace mDelegatedSupply -- Since the user can specify total supply and delegated amount, the non-delegated amount is: nonDelegCoinRaw = totalSupply - delegCoinRaw