-
Notifications
You must be signed in to change notification settings - Fork 17
feat: add total reward for epoch for each user #204
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
Merged
sug0
merged 31 commits into
anoma:main
from
neocybereth:feat/add-total-reward-for-epoch
Mar 31, 2025
+198
−23
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a3040ff
feat: add total reward for epoch
neocybereth 523a368
fix: add migration to add epoch field to rewwrds table
neocybereth 5030f97
fix: restore sample_env
neocybereth 3540112
fix: add rewards migrations
neocybereth 90fecd6
fix: add pos_rewards table
neocybereth 2146524
fix: update migrations
neocybereth 59726d0
fix: update migration
neocybereth 149ed55
fix: update accoridng to review
neocybereth 92e0aa7
fix: formatting on schema
neocybereth c61a2e6
fix: update rewards epoch func
neocybereth 0957a4a
fix: orm pos_rewards fix for bigdecimal
neocybereth 1244bab
fix: update sql statements
neocybereth fae5e1f
fix: add webserver endpoint
neocybereth f2aade5
fix: update rewards deletion
neocybereth abd16ec
fix: add update to tables
neocybereth b129655
fix: add epoch to rewawrd finder
neocybereth 64a9fa6
fix: add get reward by latest epoch
neocybereth de515f0
fix: remove unnecessary parens
neocybereth d36ec9e
fix: update according to joels commit 02ada1263c8e07f7e14fd323189307a…
neocybereth bae0188
fix: remove unnecessary type
neocybereth 7320744
fix: add in 68d63cf0aae052e7ee0a93bc7d4b65a4b2681bf1
neocybereth c393c22
fix: merge
neocybereth cc051da
fix: bring in new formatter
neocybereth a77e62b
fix: unused import
neocybereth f4f37fd
fix: update
neocybereth b11aa17
fix: fmt
neocybereth 0548085
trade tracing error for debug
neocybereth 9a9cb88
clone validator_address
neocybereth a479b2e
fix: propagate DB errors
neocybereth ee6bc67
fix: find validator by addy
neocybereth f41e94f
fix: fmt
neocybereth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
orm/migrations/2024-12-16-231256_add_epoch_pos_rewards_table/down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER table pos_rewards ADD CONSTRAINT pos_rewards_owner_validator_id_key UNIQUE (owner, validator_id); | ||
ALTER table pos_rewards DROP CONSTRAINT pos_rewards_owner_validator_id_epoch_key; | ||
ALTER TABLE pos_rewards DROP COLUMN epoch; | ||
ALTER TABLE pos_rewards DROP COLUMN claimed; |
9 changes: 9 additions & 0 deletions
9
orm/migrations/2024-12-16-231256_add_epoch_pos_rewards_table/up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- Populate existing records with claimed = false | ||
ALTER TABLE pos_rewards ADD COLUMN claimed BOOLEAN DEFAULT FALSE; | ||
-- Populate existing records with epoch = 0 | ||
ALTER TABLE pos_rewards ADD COLUMN epoch INTEGER NOT NULL DEFAULT 0; | ||
-- Now we can safely drop the default | ||
ALTER TABLE pos_rewards ALTER COLUMN epoch DROP DEFAULT; | ||
-- Also update the UNIQUE constraint to include the epoch column | ||
ALTER table pos_rewards ADD CONSTRAINT pos_rewards_owner_validator_id_epoch_key unique (owner, validator_id, epoch); | ||
ALTER table pos_rewards DROP CONSTRAINT pos_rewards_owner_validator_id_key; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.