diff --git a/cmd/soroban-cli/src/commands/contract/deploy.rs b/cmd/soroban-cli/src/commands/contract/deploy.rs index 4fabdb291..b537f37b9 100644 --- a/cmd/soroban-cli/src/commands/contract/deploy.rs +++ b/cmd/soroban-cli/src/commands/contract/deploy.rs @@ -10,8 +10,8 @@ use soroban_env_host::{ AccountId, ContractExecutable, ContractIdPreimage, ContractIdPreimageFromAddress, CreateContractArgs, Error as XdrError, Hash, HashIdPreimage, HashIdPreimageContractId, HostFunction, InvokeHostFunctionOp, Memo, MuxedAccount, Operation, OperationBody, - Preconditions, PublicKey, ScAddress, SequenceNumber, Transaction, TransactionExt, Uint256, - VecM, WriteXdr, ScMetaV0, ScMetaEntry, + Preconditions, PublicKey, ScAddress, ScMetaEntry, ScMetaV0, SequenceNumber, Transaction, + TransactionExt, Uint256, VecM, WriteXdr, }, HostError, }; @@ -81,14 +81,14 @@ pub enum Error { #[error("cannot parse WASM file {wasm}: {error}")] CannotParseWasm { wasm: std::path::PathBuf, - error: wasm::Error + error: wasm::Error, }, #[error("Must provide either --wasm or --wash-hash")] WasmNotProvided, #[error("the deployed smart contract {wasm} was built with Soroban Rust SDK v{version}, a release candidate version not intended for use with the Stellar Public Network. To deploy anyway, use --ignore-checks")] ContractCompiledWithReleaseCandidateSdk { wasm: std::path::PathBuf, - version: String + version: String, }, #[error(transparent)] Rpc(#[from] rpc::Error), @@ -107,18 +107,18 @@ impl Cmd { pub async fn run_and_get_contract_id(&self) -> Result { if let Some(wasm_path) = &self.wasm { - let wasm_args = wasm::Args { wasm: wasm_path.clone() }; - let wasm_spec = wasm_args.parse().map_err(|e| { - Error::CannotParseWasm { - wasm: wasm_path.clone(), - error: e - } + let wasm_args = wasm::Args { + wasm: wasm_path.clone(), + }; + let wasm_spec = wasm_args.parse().map_err(|e| Error::CannotParseWasm { + wasm: wasm_path.clone(), + error: e, })?; if let Some(rs_sdk_ver) = get_contract_meta_sdk_version(&wasm_spec) { if rs_sdk_ver.contains("rc") && !self.ignore_checks { - return Err(Error::ContractCompiledWithReleaseCandidateSdk { + return Err(Error::ContractCompiledWithReleaseCandidateSdk { wasm: wasm_path.clone(), - version: rs_sdk_ver + version: rs_sdk_ver, }); } else if rs_sdk_ver.contains("rc") { tracing::warn!("the deployed smart contract {path} was built with Soroban Rust SDK v{rs_sdk_ver}, a release candidate version not intended for use with the Stellar Public Network", path = wasm_path.display()); @@ -190,11 +190,9 @@ impl Cmd { fn get_contract_meta_sdk_version(wasm_spec: &utils::contract_spec::ContractSpec) -> Option { let rs_sdk_version_option = if let Some(_meta) = &wasm_spec.meta_base64 { - wasm_spec.meta.iter().find(|entry| { - match entry { - ScMetaEntry::ScMetaV0(ScMetaV0 { key, .. }) => { - key.to_string_lossy().contains(CONTRACT_META_SDK_KEY) - } + wasm_spec.meta.iter().find(|entry| match entry { + ScMetaEntry::ScMetaV0(ScMetaV0 { key, .. }) => { + key.to_string_lossy().contains(CONTRACT_META_SDK_KEY) } }) } else {