Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch] Fix bug where we're identifying v2 inserts wrong #523

Merged
merged 1 commit into from
Sep 25, 2024
Merged
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
6 changes: 4 additions & 2 deletions rust/processor/src/processors/fungible_asset_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,12 @@ impl ProcessorTrait for FungibleAssetProcessor {
(vec![], vec![])
} else {
// Basically we need to split the current unified balances into v1 and v2
// by looking at whether asset_type_v1 is null (must be v1 if not null)
// by looking at whether asset_type_v2 is null (must be v1 if it's null)
// Note, we can't check asset_type_v1 is none because we're now filling asset_type_v1
// for certain assets
current_unified_fungible_asset_balances
.into_iter()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@yuunlimm let's start adding this as the first test. ❤️

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bowenyang007 what's the transaction version if any?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea this v1 and v2 thing is easy to miss.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we might need custom transactions for this b/c idk if there's a single transaction on testnet or mainnet representative. or we can just write a script and deploy to testnet lol

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually this one on mainnet should break if the logic is wrong: 1669115601

Copy link
Collaborator

Choose a reason for hiding this comment

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

nice.

.partition(|x| x.asset_type_v1.is_some())
.partition(|x| x.asset_type_v2.is_none())
};

if self
Expand Down
Loading