Skip to content

Commit

Permalink
Rename inputs_from_transaction_id to get_transaction_inputs (#2129)
Browse files Browse the repository at this point in the history
* Rename inputs_from_transaction_id to get_transaction_inputs

* Update sdk/tests/client/high_level.rs

Co-authored-by: Thibault Martinez <[email protected]>

---------

Co-authored-by: Thibault Martinez <[email protected]>
  • Loading branch information
Thoralf-M and thibault-martinez authored Mar 5, 2024
1 parent 12e5ec8 commit 8c83dcf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ required-features = ["client"]
# High Level examples

[[example]]
name = "inputs_from_transaction_id"
path = "examples/client/high_level/inputs_from_transaction_id.rs"
name = "get_transaction_inputs"
path = "examples/client/high_level/get_transaction_inputs.rs"
required-features = ["client"]

[[example]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
//! cargo run --release --example inputs_from_transaction_id <TRANSACTION_ID>
//! cargo run --release --example get_transaction_inputs <TRANSACTION_ID>
//! ```

use iota_sdk::{client::Client, types::block::payload::signed_transaction::TransactionId};
Expand All @@ -30,7 +30,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.expect("missing example argument: TRANSACTION ID")
.parse::<TransactionId>()?;

let inputs = client.inputs_from_transaction_id(&transaction_id).await?;
let inputs = client.get_transaction_inputs(&transaction_id).await?;

println!("Transaction inputs:\n{:#?}", inputs);

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/client/api/high_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{

impl Client {
/// Get the inputs of a transaction for the given transaction id.
pub async fn inputs_from_transaction_id(
pub async fn get_transaction_inputs(
&self,
transaction_id: &TransactionId,
) -> Result<Vec<OutputWithMetadataResponse>, ClientError> {
Expand Down
4 changes: 2 additions & 2 deletions sdk/tests/client/high_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use crate::client::{common::setup_client_with_node_health_ignored, node_api::set

#[ignore]
#[tokio::test]
async fn test_find_inputs_from_transaction_id() {
async fn test_get_transaction_inputs() {
let client = setup_client_with_node_health_ignored().await;
let (_block_id, transaction_id) = setup_transaction_block(&client).await;
let inputs = client.inputs_from_transaction_id(&transaction_id).await.unwrap();
let inputs = client.get_transaction_inputs(&transaction_id).await.unwrap();

assert_eq!(inputs.len(), 1);
}
Expand Down

0 comments on commit 8c83dcf

Please sign in to comment.