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

feat(iota/docs): add dev inspect test and docs #5022

Merged
merged 4 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion crates/iota/src/client_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2962,11 +2962,11 @@ async fn execute_dev_inspect(
) -> Result<IotaClientCommandResult, anyhow::Error> {
let client = context.get_client().await?;
let gas_budget = gas_budget.map(iota_serde::BigInt::from);
let mut gas_objs = vec![];
let gas_objects = if let Some(gas_payment) = gas_payment {
if gas_payment.is_empty() {
None
} else {
let mut gas_objs = vec![];
for o in gas_payment.iter() {
let obj_ref = context.get_object_ref(*o).await?;
gas_objs.push(obj_ref);
Expand Down
15 changes: 15 additions & 0 deletions crates/iota/tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4578,3 +4578,18 @@ async fn test_call_command_emit_args() -> Result<(), anyhow::Error> {

Ok(())
}

#[sim_test]
async fn test_ptb_dev_inspect() -> Result<(), anyhow::Error> {
let mut test_cluster = TestClusterBuilder::new().build().await;
let context = &mut test_cluster.wallet;

let publish_ptb_string = r#"
--assign hello_option "some('Hello')" \
--move-call std::option::borrow "<std::string::String>" hello_option \
--dev-inspect
"#;
let args = shlex::split(publish_ptb_string).unwrap();
iota::client_ptb::ptb::PTB { args }.execute(context).await?;
Ok(())
}
Loading
Loading