-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: ETCM-8948 get-scripts command (#275)
- Loading branch information
1 parent
183b319
commit f9fcfa1
Showing
5 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use jsonrpsee::http_client::HttpClient; | ||
use partner_chains_cardano_offchain::scripts_data::get_scripts_data_with_ogmios; | ||
use sidechain_domain::UtxoId; | ||
|
||
#[derive(Clone, Debug, clap::Parser)] | ||
pub struct GetScripts { | ||
#[clap(flatten)] | ||
common_arguments: crate::CommonArguments, | ||
#[arg(long, short = 'c')] | ||
genesis_utxo: UtxoId, | ||
} | ||
|
||
impl GetScripts { | ||
pub async fn execute(self) -> crate::CmdResult<()> { | ||
let client = HttpClient::builder().build(self.common_arguments.ogmios_host)?; | ||
let scripts_data = get_scripts_data_with_ogmios(self.genesis_utxo, client).await?; | ||
|
||
let json = serde_json::to_string_pretty(&scripts_data)?; | ||
|
||
print!("{json}"); | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters