-
Notifications
You must be signed in to change notification settings - Fork 44
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
Championship arena GQL update #1415
base: development
Are you sure you want to change the base?
Championship arena GQL update #1415
Conversation
Additional state extension methods are available if the context is also IAccountStateDelta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. I have a few questions, so I left a comment.
using Bencodex.Types; | ||
using Libplanet; | ||
using Libplanet.Action; | ||
using Libplanet.Assets; | ||
|
||
namespace NineChronicles.Headless.GraphTypes.States | ||
{ | ||
public class StateContext | ||
public class StateContext : IAccountStateDelta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to inherit from IAccountStateDelta
? I wonder where it is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IAccountStateDelta allows using GetSheets, TryGetArenaParticipants, TryGetArenaInformation, TryGetArenaScore Would it make sense to just import those methods and duplicate them in the StateContext?
@@ -54,7 +54,8 @@ public StandaloneQuery(StandaloneContext standaloneContext, IConfiguration confi | |||
|
|||
return new StateContext( | |||
chain.ToAccountStateGetter(blockHash), | |||
chain.ToAccountBalanceGetter(blockHash) | |||
chain.ToAccountBalanceGetter(blockHash), | |||
chain.Tip.Index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even when a block hash is given as an argument, but block index always use latest index. it may cause confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I submitted a new commit to address the issue to use the right block index.
{ | ||
AccountStateGetter = accountStateGetter; | ||
AccountBalanceGetter = accountBalanceGetter; | ||
ChainTipIndex = chainTipIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is chainTipIndex used? I can't see where it's used, is there a reason it was added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I didn't get everything over to this branch previously. I needed the index to determine if 0 tickets is actually 0 or should be 8 and they haven't battled since the reset. I have now included the code that uses the index.
arenaInfo.Ticket = arenaInformation.Ticket; | ||
arenaInfo.Lose = arenaInformation.Lose; | ||
arenaInfo.Score = arenaScore.Score; | ||
arenaInformations.Add(arenaInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to sorting this arenaInformations
same with client, and check this function.
- Ranking is determined by score.
- The same score is displayed in the same rank.
- The same rank at this time is the sum of the number of equal ranks from the previous rank.
- The next rank of the same rank is the next rank of the same rank.
e.g., You can check what we expect with Data source and Unit test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the proper ranking and sorting to the PR. Will need to modify when the function moves to lib9c to keep it consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can't understand ordering of ChampionArenaInfo
please check @boscohyun
Additional state extension methods are available if the context is also IAccountStateDelta
I ran some tests and made sure that rank was exposed and properly calculated vs client and corrected some issues with the code and also merged in the latest from the development branch. |
…rogStar/NineChronicles.Headless into Championship-Arena-Gql-Update
Merge `rc-v100351` into `main`
…-main Merge `rc-v100360-1` to main
bump lib9c (main)
Fix release workflow bug
fix syntax error
⬆️ Bump lib9c v100361
⬆️ [rc-v100370] Bump lib9c
Bump Lib9c v100361 # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEESrITiRCjYKFI2nN2C4+hGGGQlhQFAmPczjcACgkQC4+hGGGQ # lhTh9BAAiOhler1K9YKEKOOxuSJ2u4HsCvqTqF8C42drnx75TADUG8lS720QlA4c # B0TlzTxCkohCDGjQ74a4DPddzh9j8WH+IOlXEyGLbLy+M8r3oRhcePbs3pv/rTCU # Ym1t0dvWkgHB5RbGTDrzKV/AHM3PVoM6UI4HbIkbBVk7Z3vDzHM8KNqfT1MX7R2q # oxRwbdQoiFuZPzu5HADtvIPS6ObZy12/l4JBGCaDjImmFFeogaT3gKTyYPKm20r0 # NHtWlE07Rg52qdlWofFxhDQ8PWQ6bJWkObQB534Qd3CjUdKPXXSU8AjK5pOA2yQH # aURgoJRD76lY5ph2GK8ASdj49KNZuF4+/ZE/6bDEjxqz/UepGq/PFCSm4z97GAmW # V7EIQ2FtKVnoCsVDIYv9eU6rexK7grs5ghvYQegG/yYIDGcrACopNe8DnFa32tPc # /c2+N77WZ8braeFsw70ojKFaDzkLtZXWwARrtTcTmlDcd8I3jupbTazTrbGhIzPQ # v+XW5DupUY9QNEn4KNhpopyApE3MyAo4DNrsW9lEjCPjVZBGF5IG5MTIRSFKlj/2 # HeBZSJ1WSDXDifc/9tTRrhTCDjCv6bvOO7vsT90a4C+W8MASwA7/n1gq6sQUyOaP # QYBTiOLHBEMFSXeVRVPbGsXAxOgsJmHwyey/kyoEzfiYzLXzheU= # =jlhk # -----END PGP SIGNATURE----- # gpg: Signature made Fri Feb 3 18:04:55 2023 # gpg: using RSA key 4AB2138910A360A148DA73760B8FA11861909614 # gpg: Can't check signature: No public key
merge rc-v100370-1 into main
Bump lib9c v100371
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
I added some additional models, added the chain tip index to the StateContext, and inherited from IAccountStateDelta to allow all of the extension methods to get the arena data. The old weekly arena is still available to get data for older arena rounds.