Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate contract inspect #1636

Merged
merged 5 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Deprecate contract inspect
  • Loading branch information
Ifropc committed Sep 27, 2024
commit f311b9bfecfa21d5e45c34959a23c1bb456a18de
4 changes: 2 additions & 2 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Tools for smart contract developers
* `id` — Generate the contract id for a given contract or asset
* `info` — Access info about contracts
* `init` — Initialize a Soroban project with an example contract
* `inspect` — Inspect a WASM file listing contract functions, meta, etc
* `inspect` — (Deprecated) Inspect a WASM file listing contract functions, meta, etc
* `install` — Install a WASM file to the ledger without creating a contract instance
* `invoke` — Invoke a contract function
* `optimize` — Optimize a WASM file
Expand Down Expand Up @@ -634,7 +634,7 @@ Initialize a Soroban project with an example contract

## `stellar contract inspect`

Inspect a WASM file listing contract functions, meta, etc
(Deprecated) Inspect a WASM file listing contract functions, meta, etc

**Usage:** `stellar contract inspect [OPTIONS] --wasm <WASM>`

Expand Down
8 changes: 7 additions & 1 deletion cmd/soroban-cli/src/commands/contract/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use std::{fmt::Debug, path::PathBuf};
use tracing::debug;

use super::SpecOutput;
use crate::commands::global::Args;
use crate::print::Print;
use crate::{config::locator, wasm};

#[derive(Parser, Debug, Clone)]
Expand Down Expand Up @@ -33,7 +35,11 @@ pub enum Error {
}

impl Cmd {
pub fn run(&self) -> Result<(), Error> {
pub fn run(&self, global_args: &Args) -> Result<(), Error> {
Print::new(global_args.quiet).warnln(
"`contract inspect` has been deprecated in favor of `contract info`. \
Please use `contract info` instead.",
);
let wasm = self.wasm.parse()?;
debug!("File: {}", self.wasm.wasm.to_string_lossy());
let output = match self.output {
Expand Down
5 changes: 3 additions & 2 deletions cmd/soroban-cli/src/commands/contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ pub enum Cmd {
/// Initialize a Soroban project with an example contract
Init(init::Cmd),

/// Inspect a WASM file listing contract functions, meta, etc
/// (Deprecated) Inspect a WASM file listing contract functions, meta, etc
Ifropc marked this conversation as resolved.
Show resolved Hide resolved
#[command(display_order = 100)]
Inspect(inspect::Cmd),

/// Install a WASM file to the ledger without creating a contract instance
Expand Down Expand Up @@ -147,7 +148,7 @@ impl Cmd {
Cmd::Id(id) => id.run()?,
Cmd::Info(info) => info.run().await?,
Cmd::Init(init) => init.run(global_args)?,
Cmd::Inspect(inspect) => inspect.run()?,
Cmd::Inspect(inspect) => inspect.run(global_args)?,
Cmd::Install(install) => install.run(global_args).await?,
Cmd::Invoke(invoke) => invoke.run(global_args).await?,
Cmd::Optimize(optimize) => optimize.run()?,
Expand Down
Loading