Skip to content
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 crates/rust-client/src/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl<AUTH> Client<AUTH> {
}
}

let tracked_account = self.store.get_account(account.id()).await?;
let tracked_account = self.store.get_minimal_partial_account(account.id()).await?;

match tracked_account {
None => {
Expand Down Expand Up @@ -467,7 +467,7 @@ impl<AUTH> Client<AUTH> {
return Err(ClientError::AddressAlreadyTracked(address_bench32));
}

let tracked_account = self.store.get_account(account_id).await?;
let tracked_account = self.store.get_minimal_partial_account(account_id).await?;
match tracked_account {
None => Err(ClientError::AccountDataNotFound(account_id)),
Some(tracked_account) => {
Expand Down
10 changes: 3 additions & 7 deletions crates/rust-client/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ where
account: &Account,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should get refactored as part of #2277

transaction_request: TransactionRequest,
) -> Result<PreparedTransaction, ClientError> {
let account_id = account.id();
self.validate_recency().await?;
validate_account_request(&transaction_request, account)?;

Expand Down Expand Up @@ -400,7 +399,6 @@ where
let future_notes: Vec<(NoteDetails, NoteTag)> =
transaction_request.expected_future_notes().cloned().collect();

let account = self.try_get_account(account_id).await?;
let tx_script = transaction_request.build_transaction_script(&account.code_interface())?;

let foreign_accounts = transaction_request.foreign_accounts().clone();
Expand Down Expand Up @@ -797,18 +795,16 @@ where
self.get_sync_height().await?
};

let account_record = self
let account_code = self
.store
.get_account(account_id)
.get_account_code(account_id)
.await?
.ok_or(ClientError::AccountDataNotFound(account_id))?;

let account: Account = account_record.try_into()?;

let data_store = ClientDataStore::new(self.store.clone(), self.rpc_api.clone());

// Ensure code is loaded on MAST store
data_store.mast_store().load_account_code(account.code());
data_store.mast_store().load_account_code(&account_code);

for fpi_account in &foreign_account_inputs {
data_store.mast_store().load_account_code(fpi_account.code());
Expand Down
Loading