Skip to content

Commit

Permalink
fix typo plus error
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Oct 24, 2023
1 parent 0dd823c commit e35a66e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/fuels-accounts/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use fuels_core::{
bech32::{Bech32Address, Bech32ContractId},
coin::Coin,
coin_type::CoinType,
errors::{Error, Result},
errors::{error, Error, Result},
input::Input,
message::Message,
transaction::TxParameters,
Expand Down Expand Up @@ -231,7 +231,7 @@ pub trait Account: ViewOnlyAccount {
balance: u64,
asset_id: AssetId,
tx_parameters: TxParameters,
) -> std::result::Result<(String, Vec<Receipt>), Error> {
) -> Result<(String, Vec<Receipt>)> {
let provider = self.try_provider()?;
let network_info = provider.network_info().await?;

Expand Down Expand Up @@ -291,7 +291,7 @@ pub trait Account: ViewOnlyAccount {
to: &Bech32Address,
amount: u64,
tx_parameters: TxParameters,
) -> std::result::Result<(TxId, Nonce, Vec<Receipt>), Error> {
) -> Result<(TxId, Nonce, Vec<Receipt>)> {
let provider = self.try_provider()?;
let network_info = provider.network_info().await?;

Expand All @@ -315,8 +315,10 @@ pub trait Account: ViewOnlyAccount {
.await?
.take_receipts_checked(None)?;

let message_nonce = extract_message_nonce(&receipts)
.expect("MessageId could not be retrieved from tx receipts.");
let message_nonce = extract_message_nonce(&receipts).ok_or(error!(
InvalidData,
"Message nonce could not be retrieved from tx receipts."
))?;

Ok((tx_id, message_nonce, receipts))
}
Expand Down

0 comments on commit e35a66e

Please sign in to comment.