Skip to content

Commit

Permalink
add version number ro run command
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Sep 11, 2024
1 parent 7a275fc commit b119b5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ At the moment this project **does not** adhere to
- Attestation pallet ([#1003](https://github.com/entropyxyz/entropy-core/pull/1003))
- Update test CLI for new registration and signing flows ([#1008](https://github.com/entropyxyz/entropy-core/pull/1008))
- Add remove program function to entropy-client ([#1023](https://github.com/entropyxyz/entropy-core/pull/1023))
- Programs version ([#1045](https://github.com/entropyxyz/entropy-core/pull/1045))
- Add a programs version ([#1045](https://github.com/entropyxyz/entropy-core/pull/1045))

### Changed
- Fix TSS `AccountId` keys in chainspec ([#993](https://github.com/entropyxyz/entropy-core/pull/993))
Expand Down
8 changes: 7 additions & 1 deletion crates/test-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ enum CliCommand {
/// The path to a file containing the program aux interface (defaults to empty)
aux_data_interface_file: Option<PathBuf>,
/// The version number of the program you compiled with
version_number: u8,
version_number: Option<u8>,
/// The mnemonic to use for the call
#[arg(short, long)]
mnemonic_option: Option<String>,
Expand Down Expand Up @@ -176,6 +176,7 @@ pub async fn run_command(
program_file_option: Option<PathBuf>,
config_interface_file_option: Option<PathBuf>,
aux_data_interface_file_option: Option<PathBuf>,
program_version_number_option: Option<u8>,
) -> anyhow::Result<String> {
let cli = Cli::parse();

Expand Down Expand Up @@ -296,6 +297,11 @@ pub async fn run_command(
)?,
};

let version_number = match program_version_number_option {
Some(version_number) => version_number,
None => version_number.expect("No Version number passed"),
};

let hash = store_program(
&api,
&rpc,
Expand Down
2 changes: 1 addition & 1 deletion crates/test-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use entropy_test_cli::run_command;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let now = Instant::now();
match run_command(None, None, None).await {
match run_command(None, None, None, None).await {
Ok(output) => {
println!("Success: {}", output.green());
println!("{}", format!("That took {:?}", now.elapsed()).yellow());
Expand Down

0 comments on commit b119b5e

Please sign in to comment.