From da03c57b7c35076e3c0d1f61d192e117282f126f Mon Sep 17 00:00:00 2001 From: hal3e Date: Fri, 22 Nov 2024 10:12:42 +0100 Subject: [PATCH] fix merge --- e2e/tests/predicates.rs | 3 +-- examples/wallets/src/lib.rs | 3 +-- packages/fuels-accounts/src/provider.rs | 12 +++++------- .../fuels-accounts/src/provider/retryable_client.rs | 2 +- packages/fuels-accounts/src/schema/schema.sdl | 2 +- .../src/types/wrappers/transaction_response.rs | 13 +++++++------ 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/e2e/tests/predicates.rs b/e2e/tests/predicates.rs index 58642149b8..0f1faed0ca 100644 --- a/e2e/tests/predicates.rs +++ b/e2e/tests/predicates.rs @@ -428,8 +428,7 @@ async fn predicate_transfer_to_base_layer() -> Result<()> { let proof = predicate .try_provider()? .get_message_proof(&tx_id, &msg_nonce, None, Some(2)) - .await? - .expect("failed to retrieve message proof"); + .await?; assert_eq!(proof.amount, amount); assert_eq!(proof.recipient, base_layer_address); diff --git a/examples/wallets/src/lib.rs b/examples/wallets/src/lib.rs index dff23836b1..f52f5064de 100644 --- a/examples/wallets/src/lib.rs +++ b/examples/wallets/src/lib.rs @@ -376,8 +376,7 @@ mod tests { let proof = wallet .try_provider()? .get_message_proof(&tx_id, &msg_id, None, Some(2)) - .await? - .expect("failed to retrieve message proof"); + .await?; // Verify the amount and recipient assert_eq!(proof.amount, amount); diff --git a/packages/fuels-accounts/src/provider.rs b/packages/fuels-accounts/src/provider.rs index c64e1dceac..7dc48a4ad5 100644 --- a/packages/fuels-accounts/src/provider.rs +++ b/packages/fuels-accounts/src/provider.rs @@ -696,19 +696,17 @@ impl Provider { nonce: &Nonce, commit_block_id: Option<&Bytes32>, commit_block_height: Option, - ) -> Result> { - let proof = self - .client + ) -> Result { + self.client .message_proof( tx_id, nonce, commit_block_id.map(Into::into), commit_block_height.map(Into::into), ) - .await? - .map(Into::into); - - Ok(proof) + .await + .map(Into::into) + .map_err(Into::into) } pub async fn is_user_account(&self, address: impl Into) -> Result { diff --git a/packages/fuels-accounts/src/provider/retryable_client.rs b/packages/fuels-accounts/src/provider/retryable_client.rs index 3a7c0c66af..624df3f429 100644 --- a/packages/fuels-accounts/src/provider/retryable_client.rs +++ b/packages/fuels-accounts/src/provider/retryable_client.rs @@ -300,7 +300,7 @@ impl RetryableClient { nonce: &Nonce, commit_block_id: Option<&BlockId>, commit_block_height: Option, - ) -> RequestResult> { + ) -> RequestResult { self.wrap(|| { self.client .message_proof(transaction_id, nonce, commit_block_id, commit_block_height) diff --git a/packages/fuels-accounts/src/schema/schema.sdl b/packages/fuels-accounts/src/schema/schema.sdl index b9048362ca..54db4ec099 100644 --- a/packages/fuels-accounts/src/schema/schema.sdl +++ b/packages/fuels-accounts/src/schema/schema.sdl @@ -980,7 +980,7 @@ type Query { """ owner: Address, first: Int, after: String, last: Int, before: String ): MessageConnection! - messageProof(transactionId: TransactionId!, nonce: Nonce!, commitBlockId: BlockId, commitBlockHeight: U32): MessageProof + messageProof(transactionId: TransactionId!, nonce: Nonce!, commitBlockId: BlockId, commitBlockHeight: U32): MessageProof! messageStatus(nonce: Nonce!): MessageStatus! relayedTransactionStatus( """ diff --git a/packages/fuels-core/src/types/wrappers/transaction_response.rs b/packages/fuels-core/src/types/wrappers/transaction_response.rs index 428f6db29a..d2051771c0 100644 --- a/packages/fuels-core/src/types/wrappers/transaction_response.rs +++ b/packages/fuels-core/src/types/wrappers/transaction_response.rs @@ -5,6 +5,7 @@ use fuel_core_client::client::types::{ TransactionResponse as ClientTransactionResponse, TransactionStatus as ClientTransactionStatus, TransactionType as ClientTxType, }; +use fuel_tx::Transaction; use fuel_types::BlockHeight; use crate::types::{transaction::TransactionType, tx_status::TxStatus}; @@ -36,12 +37,12 @@ impl From for TransactionResponse { }; let transaction = match client_response.transaction { - ClientTxType::Script(tx) => TransactionType::Script(tx.into()), - ClientTxType::Create(tx) => TransactionType::Create(tx.into()), - ClientTxType::Mint(tx) => TransactionType::Mint(tx.into()), - ClientTxType::Upgrade(tx) => TransactionType::Upgrade(tx.into()), - ClientTxType::Upload(tx) => TransactionType::Upload(tx.into()), - ClientTxType::Blob(tx) => TransactionType::Blob(tx.into()), + ClientTxType::Known(Transaction::Script(tx)) => TransactionType::Script(tx.into()), + ClientTxType::Known(Transaction::Create(tx)) => TransactionType::Create(tx.into()), + ClientTxType::Known(Transaction::Mint(tx)) => TransactionType::Mint(tx.into()), + ClientTxType::Known(Transaction::Upgrade(tx)) => TransactionType::Upgrade(tx.into()), + ClientTxType::Known(Transaction::Upload(tx)) => TransactionType::Upload(tx.into()), + ClientTxType::Known(Transaction::Blob(tx)) => TransactionType::Blob(tx.into()), ClientTxType::Unknown => TransactionType::Unknown, };