Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Nov 22, 2024
1 parent 5d2a952 commit da03c57
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
3 changes: 1 addition & 2 deletions e2e/tests/predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions examples/wallets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 5 additions & 7 deletions packages/fuels-accounts/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -696,19 +696,17 @@ impl Provider {
nonce: &Nonce,
commit_block_id: Option<&Bytes32>,
commit_block_height: Option<u32>,
) -> Result<Option<MessageProof>> {
let proof = self
.client
) -> Result<MessageProof> {
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<Bytes32>) -> Result<bool> {
Expand Down
2 changes: 1 addition & 1 deletion packages/fuels-accounts/src/provider/retryable_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl RetryableClient {
nonce: &Nonce,
commit_block_id: Option<&BlockId>,
commit_block_height: Option<BlockHeight>,
) -> RequestResult<Option<MessageProof>> {
) -> RequestResult<MessageProof> {
self.wrap(|| {
self.client
.message_proof(transaction_id, nonce, commit_block_id, commit_block_height)
Expand Down
2 changes: 1 addition & 1 deletion packages/fuels-accounts/src/schema/schema.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
"""
Expand Down
13 changes: 7 additions & 6 deletions packages/fuels-core/src/types/wrappers/transaction_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -36,12 +37,12 @@ impl From<ClientTransactionResponse> 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,
};

Expand Down

0 comments on commit da03c57

Please sign in to comment.