Skip to content

feat: add Ledger module and Ledger Transaction schema #1179

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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

mFragaBA
Copy link
Contributor

@mFragaBA mFragaBA commented Apr 22, 2025

Motivation

We want a reliable way to register and track all currency flows (for example, you buy a skin, level up a champion, get some rewards, etc.)

Explain why not how.
Closes #563

Summary of changes

  • Added Ledger module with functions to do 2 things:
    • register a user getting some currencies
    • register auser spending some currencies
  • Removed functions to add/remove currency from users in Currencies module and replaced all calls with ledger calls

The functions in the ledger module respond to 2 use cases:

  • add/remove currency as a single transaction
  • add/remove currency as part of a greater transaction

How to test it?

This does many small changes in a lot of places so I would say the way to test it would be to do all currency related actions in game:

  • collect quest rewards
  • win a game (coming out in 1st, 2nd, 3rd place)
  • spend gold to buy skins
  • spend gold to level up

Checklist

  • Tested the changes locally.
  • Reviewed the changes on GitHub, line by line.
  • This change requires new documentation.
    • Documentation has been added/updated.

@mFragaBA mFragaBA force-pushed the 563-add-transaction-ledger branch from 0419bb9 to 252553d Compare April 22, 2025 19:17
@mFragaBA mFragaBA force-pushed the 563-add-transaction-ledger branch from 252553d to 2b8b720 Compare April 22, 2025 20:59
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.

[REFACTOR] Currencies balances as a transaction log
1 participant