Skip to content

Commit

Permalink
Last fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leboiko committed Dec 21, 2024
1 parent 4dd90c8 commit 2745d8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion consumer/src/mode/decoded/atom/atom_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ impl AtomCreated {
pg_pool: &PgPool,
) -> Result<Account, ConsumerError> {
// First try to find existing account
if let Some(account) = Account::find_by_id(self.atomWallet.to_string(), pg_pool).await? {
if let Some(mut account) = Account::find_by_id(self.atomWallet.to_string(), pg_pool).await?
{
// We update the account type to `AtomWallet` if it is not already set
if account.account_type != AccountType::AtomWallet {
account.account_type = AccountType::AtomWallet;
account.upsert(pg_pool).await?;
}
return Ok(account);
}

Expand Down
2 changes: 1 addition & 1 deletion consumer/src/mode/resolver/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
};
use alloy::primitives::Address;
use models::{
account::{Account, AccountType},
account::Account,
atom::{Atom, AtomType},
traits::SimpleCrud,
};
Expand Down

0 comments on commit 2745d8a

Please sign in to comment.