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

Rename inputs_from_transaction_id to get_transaction_inputs #2129

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
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
Loading