Skip to content

Conversation

@sea212
Copy link

@sea212 sea212 commented Jan 26, 2023

Fundamental issue: Block indexers and processors like Subsquid have a really hard time to track locks.

This PR mirrors updates within pallet-balances: paritytech/substrate#12287

Difference in respect to paritytech/substrate#12287:

  • A currency_id field was added to the events
  • The lock reason was removed from the events (no differentiation between MISC and FEE reasons)

The tests cases were adjusted to the previously mentioned differences:

Locks = []                          --> [10/DOT]                    // emits Locked(currency_id: DOT, ..., amount=10)
Locks = [10/DOT]                    --> [15/DOT]                    // emits Locked(currency_id: DOT, ..., amount=5)
Locks = [15/DOT]                    --> [15/DOT, 20/BTC]            // emits Locked(currency_id: BTC, ..., amount=20)
Locks = [15/DOT, 20/BTC]            --> [15/DOT, 20/BTC, 10/DOT]    // emits nothing
Locks = [15/DOT, 20/BTC, 10/DOT]    --> [15/DOT, 20/BTC, 12/DOT]    // emits nothing
Locks = [15/DOT, 20/BTC, 12/DOT]    --> [15/DOT, 20/BTC, 10/DOT]    // emits nothing
Locks = [15/DOT, 20/BTC, 10/DOT]    --> [15/DOT, 20/BTC, 20/DOT]    // emits Locked(currency_id: DOT, ..., amount=5)
Locks = [15/DOT, 20/BTC, 20/DOT]    --> [15/DOT, 20/BTC, 16/DOT]    // emits Unlocked(currency_id: DOT, ..., amount = 4)
Locks = [15/DOT, 20/BTC, 16/DOT]    --> [15/DOT, 12/BTC, 16/DOT]    // emits Unlocked(currency_id: BTC, ..., amount = 8)
Locks = [15/DOT, 12/BTC, 16/DOT]    --> [15/DOT, 12/BTC]            // emits Unlocked(currency_id: DOT, ..., amount = 1)

Bonus change: Replace deprecated clippy rule name.

@sea212
Copy link
Author

sea212 commented Jan 26, 2023

Oopsie, wrong repository 🤦‍♂️

@sea212 sea212 closed this Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant