From 69f4dd9ee0963e2a11281c83f2348ba51862dd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lasse=20M=C3=B8ldrup?= Date: Wed, 27 Sep 2023 13:44:44 +0200 Subject: [PATCH] Add some help texts to arguments and some comments --- generator/src/generator.rs | 18 ++++++++++++++++++ generator/src/main.rs | 8 ++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/generator/src/generator.rs b/generator/src/generator.rs index 2adee584..42586a68 100644 --- a/generator/src/generator.rs +++ b/generator/src/generator.rs @@ -292,6 +292,8 @@ impl MintCis2Generator { let info = ContractDeploymentInfo { module: MINT_CIS2_MODULE, name: "init_cis2_nft", + // Determined by running the transaction and inspecting the energy cost with + // concordium-client. init_energy: Energy::from(2397), }; let contract_address = info @@ -326,6 +328,8 @@ impl Generate for MintCis2Generator { sender_address: self.args.keys.address, nonce: self.nonce, expiry: TransactionTime::seconds_after(self.args.expiry), + // Determined by running the transaction and inspecting the energy cost with + // concordium-client and then adding extra to account for variance. energy: GivenEnergy::Absolute(Energy::from(3500)), amount: Amount::zero(), }; @@ -398,6 +402,8 @@ impl TransferCis2Generator { let info = ContractDeploymentInfo { module: TRANSFER_CIS2_MODULE, name: "init_cis2_multi", + // Determined by running the transaction and inspecting the energy cost with + // concordium-client. init_energy: Energy::from(2353), }; let contract_address = info @@ -428,6 +434,8 @@ impl TransferCis2Generator { sender_address: args.keys.address, nonce: nonce.nonce, expiry: TransactionTime::seconds_after(args.expiry), + // Determined by running the transaction and inspecting the energy cost with + // concordium-client. energy: GivenEnergy::Absolute(Energy::from(2740)), amount: Amount::zero(), }; @@ -474,6 +482,8 @@ impl Generate for TransferCis2Generator { sender_address: self.args.keys.address, nonce: self.nonce, expiry: TransactionTime::seconds_after(self.args.expiry), + // Determined by running the transaction and inspecting the energy cost with + // concordium-client and then adding extra to account for variance. energy: GivenEnergy::Absolute(Energy::from(3500)), amount: Amount::zero(), }; @@ -525,6 +535,8 @@ impl WccdGenerator { let info = ContractDeploymentInfo { module: WCCD_MODULE, name: "init_cis2_wCCD", + // Determined by running the transaction and inspecting the energy cost with + // concordium-client. init_energy: Energy::from(2596), }; let params = SetMetadataUrlParams { @@ -592,6 +604,8 @@ impl Generate for WccdGenerator { sender_address: self.args.keys.address, nonce: self.nonce, expiry: TransactionTime::seconds_after(self.args.expiry), + // Determined by running the transaction and inspecting the energy cost with + // concordium-client and then adding extra to account for variance. energy: GivenEnergy::Absolute(Energy::from(3500)), amount: Amount::zero(), }; @@ -698,6 +712,8 @@ impl RegisterCredentialsGenerator { let info = ContractDeploymentInfo { module: REGISTER_CREDENTIALS_MODULE, name: "init_credential_registry", + // Determined by running the transaction and inspecting the energy cost with + // concordium-client. init_energy: Energy::from(2970), }; // The parameters don't matter, since we can still issue, so they are all dummy @@ -752,6 +768,8 @@ impl Generate for RegisterCredentialsGenerator { sender_address: self.args.keys.address, nonce: self.nonce, expiry: TransactionTime::seconds_after(self.args.expiry), + // Determined by running the transaction and inspecting the energy cost with + // concordium-client and then adding extra to account for variance. energy: GivenEnergy::Absolute(Energy::from(5000)), amount: Amount::zero(), }; diff --git a/generator/src/main.rs b/generator/src/main.rs index 77a19c0f..280d3433 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -82,9 +82,13 @@ struct App { default_value = "http://localhost:20000" )] endpoint: Endpoint, - #[clap(long = "sender")] + #[clap(long = "sender", help = "Path to file containing sender keys.")] account: PathBuf, - #[clap(long = "tps")] + #[clap( + long = "tps", + help = "Transactions to send per second.", + default_value = "1" + )] tps: u16, #[clap( long = "expiry",