From aa72304f00ee8c34996953cc9199e83b2c18c42f Mon Sep 17 00:00:00 2001 From: koxy Date: Mon, 30 Sep 2024 23:19:24 +0100 Subject: [PATCH 1/2] modified key command int corooban cli, now has a defualt value of persistent and removed durability in the argument --- cmd/crates/soroban-test/tests/it/integration/cookbook.rs | 8 ++++---- .../soroban-test/tests/it/integration/hello_world.rs | 4 ++-- cmd/crates/soroban-test/tests/it/integration/util.rs | 4 ++-- cmd/soroban-cli/src/commands/contract/install.rs | 1 - cmd/soroban-cli/src/key.rs | 7 ++----- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/cmd/crates/soroban-test/tests/it/integration/cookbook.rs b/cmd/crates/soroban-test/tests/it/integration/cookbook.rs index 65855d775..3919798e9 100644 --- a/cmd/crates/soroban-test/tests/it/integration/cookbook.rs +++ b/cmd/crates/soroban-test/tests/it/integration/cookbook.rs @@ -82,10 +82,10 @@ async fn run_command( modified_args.push(key_xdr.to_string()); skip_next = true; } - "" => { - modified_args.push("persistent".to_string()); - skip_next = false; - } + // "" => { + // modified_args.push("persistent".to_string()); + // skip_next = false; + // } "" => { modified_args.push("COUNTER".to_string()); skip_next = false; diff --git a/cmd/crates/soroban-test/tests/it/integration/hello_world.rs b/cmd/crates/soroban-test/tests/it/integration/hello_world.rs index c982b0c40..f19559db5 100644 --- a/cmd/crates/soroban-test/tests/it/integration/hello_world.rs +++ b/cmd/crates/soroban-test/tests/it/integration/hello_world.rs @@ -246,7 +246,7 @@ fn contract_data_read_failure(sandbox: &TestEnv, id: &str) { .arg("--id") .arg(id) .arg("--key=COUNTER") - .arg("--durability=persistent") + // .arg("--durability=persistent") .assert() .failure() .stderr( @@ -273,7 +273,7 @@ async fn contract_data_read() { .arg(id) .arg("--key") .arg(KEY) - .arg("--durability=persistent") + // .arg("--durability=persistent") .assert() .success() .stdout(predicates::str::starts_with("COUNTER,1")); diff --git a/cmd/crates/soroban-test/tests/it/integration/util.rs b/cmd/crates/soroban-test/tests/it/integration/util.rs index dec7941f6..803bd72e3 100644 --- a/cmd/crates/soroban-test/tests/it/integration/util.rs +++ b/cmd/crates/soroban-test/tests/it/integration/util.rs @@ -91,8 +91,8 @@ pub async fn extend(sandbox: &TestEnv, id: &str, value: Option<&str>) { let mut args = vec![ "--id", id, - "--durability", - "persistent", + // "--durability", + // "persistent", "--ledgers-to-extend", "100001", ]; diff --git a/cmd/soroban-cli/src/commands/contract/install.rs b/cmd/soroban-cli/src/commands/contract/install.rs index 5a1842b7b..0ef04ca09 100644 --- a/cmd/soroban-cli/src/commands/contract/install.rs +++ b/cmd/soroban-cli/src/commands/contract/install.rs @@ -208,7 +208,6 @@ impl NetworkRunnable for Cmd { key_xdr: None, wasm: Some(self.wasm.wasm.clone()), wasm_hash: None, - durability: super::Durability::Persistent, }, config: config.clone(), fee: self.fee.clone(), diff --git a/cmd/soroban-cli/src/key.rs b/cmd/soroban-cli/src/key.rs index b4fd358aa..ff62bc664 100644 --- a/cmd/soroban-cli/src/key.rs +++ b/cmd/soroban-cli/src/key.rs @@ -58,10 +58,7 @@ pub struct Args { conflicts_with = "key_xdr", conflicts_with = "wasm" )] - pub wasm_hash: Option, - /// Storage entry durability - #[arg(long, value_enum, default_value = "persistent")] - pub durability: Durability, + pub wasm_hash: Option, } impl Args { @@ -105,7 +102,7 @@ impl Args { .map(|key| { LedgerKey::ContractData(LedgerKeyContractData { contract: ScAddress::Contract(xdr::Hash(contract.0)), - durability: (&self.durability).into(), + durability: xdr::ContractDataDurability::Persistent, // Always use Persistent key, }) }) From cd274bcad0a1c0b5eecf609948a602aec27b1700 Mon Sep 17 00:00:00 2001 From: koxy Date: Mon, 30 Sep 2024 23:25:57 +0100 Subject: [PATCH 2/2] modified key command int corooban cli, now has a defualt value of persistent and removed durability in the argument --- FULL_HELP_DOCS.md | 30 ------------------------------ cmd/soroban-cli/src/key.rs | 5 ++--- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index 479ac6720..2d8133f1e 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -350,16 +350,6 @@ If no keys are specified the contract itself is extended. * `--key-xdr ` — Storage key (base64-encoded XDR) * `--wasm ` — Path to Wasm file of contract code to extend * `--wasm-hash ` — Path to Wasm file of contract code to extend -* `--durability ` — Storage entry durability - - Default value: `persistent` - - Possible values: - - `persistent`: - Persistent - - `temporary`: - Temporary - * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config @@ -772,16 +762,6 @@ Print the current value of a contract-data ledger entry * `--key-xdr ` — Storage key (base64-encoded XDR) * `--wasm ` — Path to Wasm file of contract code to extend * `--wasm-hash ` — Path to Wasm file of contract code to extend -* `--durability ` — Storage entry durability - - Default value: `persistent` - - Possible values: - - `persistent`: - Persistent - - `temporary`: - Temporary - * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config @@ -807,16 +787,6 @@ If no keys are specificed the contract itself is restored. * `--key-xdr ` — Storage key (base64-encoded XDR) * `--wasm ` — Path to Wasm file of contract code to extend * `--wasm-hash ` — Path to Wasm file of contract code to extend -* `--durability ` — Storage entry durability - - Default value: `persistent` - - Possible values: - - `persistent`: - Persistent - - `temporary`: - Temporary - * `--ledgers-to-extend ` — Number of ledgers to extend the entry * `--ttl-ledger-only` — Only print the new Time To Live ledger * `--rpc-url ` — RPC server endpoint diff --git a/cmd/soroban-cli/src/key.rs b/cmd/soroban-cli/src/key.rs index ff62bc664..ad693ac4d 100644 --- a/cmd/soroban-cli/src/key.rs +++ b/cmd/soroban-cli/src/key.rs @@ -1,5 +1,4 @@ use crate::{ - commands::contract::Durability, config::{locator, network::Network}, wasm, }; @@ -58,7 +57,7 @@ pub struct Args { conflicts_with = "key_xdr", conflicts_with = "wasm" )] - pub wasm_hash: Option, + pub wasm_hash: Option, } impl Args { @@ -102,7 +101,7 @@ impl Args { .map(|key| { LedgerKey::ContractData(LedgerKeyContractData { contract: ScAddress::Contract(xdr::Hash(contract.0)), - durability: xdr::ContractDataDurability::Persistent, // Always use Persistent + durability: xdr::ContractDataDurability::Persistent, key, }) })