Skip to main content

soroban_cli/commands/contract/
id.rs

1pub mod asset;
2pub mod wasm;
3
4#[derive(Debug, clap::Subcommand)]
5pub enum Cmd {
6    /// Derive the contract id for a builtin Stellar Asset Contract
7    Asset(asset::Cmd),
8
9    /// Derive the contract id for a Wasm contract
10    Wasm(wasm::Cmd),
11}
12
13#[derive(thiserror::Error, Debug)]
14pub enum Error {
15    #[error(transparent)]
16    Asset(#[from] asset::Error),
17
18    #[error(transparent)]
19    Wasm(#[from] wasm::Error),
20}
21
22impl Cmd {
23    pub fn run(&self) -> Result<(), Error> {
24        match &self {
25            Cmd::Asset(asset) => asset.run()?,
26            Cmd::Wasm(wasm) => wasm.run()?,
27        }
28
29        Ok(())
30    }
31}