From e8bf694e5550349df58138f87eed4e07e669b551 Mon Sep 17 00:00:00 2001
From: Phuong Nguyen <ChaoticTempest@users.noreply.github.com>
Date: Tue, 4 Jun 2024 17:33:04 -0700
Subject: [PATCH] Added status_tx_async function for check tx status against
 hash (#20)

---
 near-fetch/Cargo.toml | 2 +-
 near-fetch/src/lib.rs | 2 +-
 near-fetch/src/ops.rs | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/near-fetch/Cargo.toml b/near-fetch/Cargo.toml
index 8830c60..a03a3c0 100644
--- a/near-fetch/Cargo.toml
+++ b/near-fetch/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "near-fetch"
-version = "0.3.0"
+version = "0.3.1"
 edition = "2021"
 license = "MIT OR Apache-2.0"
 readme = "../README.md"
diff --git a/near-fetch/src/lib.rs b/near-fetch/src/lib.rs
index 7b33b84..f640bcd 100644
--- a/near-fetch/src/lib.rs
+++ b/near-fetch/src/lib.rs
@@ -261,7 +261,7 @@ impl Client {
     }
 
     /// Fetches the status of a transaction given the transaction hash.
-    pub(crate) async fn tx_async_status(
+    pub async fn status_tx_async(
         &self,
         sender_id: &AccountId,
         tx_hash: CryptoHash,
diff --git a/near-fetch/src/ops.rs b/near-fetch/src/ops.rs
index be613ff..99f9f71 100644
--- a/near-fetch/src/ops.rs
+++ b/near-fetch/src/ops.rs
@@ -547,7 +547,7 @@ impl AsyncTransactionStatus {
     pub async fn status(&self) -> Result<Poll<ExecutionFinalResult>> {
         let result = self
             .client
-            .tx_async_status(&self.sender_id, self.hash, TxExecutionStatus::Included)
+            .status_tx_async(&self.sender_id, self.hash, TxExecutionStatus::Included)
             .await
             .map(ExecutionFinalResult::from_view);
 
@@ -589,7 +589,7 @@ impl AsyncTransactionStatus {
     /// Waits until a sepcific transaction status is reached.
     pub async fn wait_until(self, wait_until: TxExecutionStatus) -> Result<ExecutionFinalResult> {
         self.client
-            .tx_async_status(&self.sender_id, self.hash, wait_until)
+            .status_tx_async(&self.sender_id, self.hash, wait_until)
             .await
             .map(ExecutionFinalResult::from_view)
     }