planetarium / libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
https://docs.libplanet.io/
GNU Lesser General Public License v2.1
505 stars 139 forks source link

✨ Add `CurrencyAccount` to handle all `Currency` related logic #3779

Closed greymistcube closed 1 month ago

greymistcube commented 1 month ago

The implementation is pretty convoluted at the moment. πŸ™„ There are numerous issues regarding Currency:

This is partially due to information about Currency not being recorded in a state and migration to CurrencyAccount model does not permit adding in this missing information.

I'll be making some Currency spec and API changes in separate PRs to mitigate some of these issues. 😢

greymistcube commented 1 month ago

@OnedgeLee

Do this PR contains state migration test? Or, existing test can cover currency migration?

Migration is mostly covered by ActionEvaluatorTest.Migration.cs. Although now that I look at it, I should add Currency manipulation to the action used in MigrationThroughBlock test. πŸ˜—

greymistcube commented 1 month ago

@OnedgeLee

I've added an additional test regarding migration. See 4e5fc2fd6d08c8798f3e71dfdbe28b9eb8e93c29.