-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement node rewards calculation and API endpoint #64
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
Open
0oM4R
wants to merge
45
commits into
development
Choose a base branch
from
development_rewards
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
538c347
feat: implement node rewards calculation and API endpoint
0oM4R 3ed761e
test: add test case for uptime percentage with decimal value
0oM4R 929bad7
refactor: replace error string with proper error variable for invalid…
0oM4R bdcd279
docs: mention that the duration in seconds
0oM4R 1dcc431
feat: implement node uptime calculation based on report history
0oM4R 66b2a66
feat: add uptime percentage to rewards struct
0oM4R 0ea416e
docs: add swagger docs for the rewards endpoint
0oM4R f60aa13
feat: show uptime percentage in the response of no rewards
0oM4R 38e8082
fix: rename reward endpoint to rewards
0oM4R eb4aeca
feat: truncate reward values to 3 decimal places
0oM4R b39f7f7
feat: add uptime percentage to reward calculation in tests
0oM4R 41c2c64
refactor: rename constants and functions to follow Go naming conventions
0oM4R 6c5993c
Fix tests: pass duration as time.duration
0oM4R d80cbe0
refactor: rename and split reward calculation functions for better ma…
0oM4R 0c6094d
feat: improve error handling for node uptime reports and add test cases
0oM4R 04e5a9a
refactor: enhance loops
0oM4R ceff122
refactor: extract reward calculation logic into separate functions an…
0oM4R 5e9f390
test: add comprehensive test suite for rewards calculation and uptime…
0oM4R f538295
revert adding main.go
0oM4R 81906f9
docs: simplify uptime percentage calculation documentation with conci…
0oM4R 27c3fe8
feat: add node capacity rewards calculation endpoint and types
0oM4R b69397d
fix node tests in client
Eslam-Nawara 395a4fc
WIP: add rewards tests in client
0oM4R 55e7ea8
remove extra println
Eslam-Nawara c4f1136
tests: add more test cases for the rewards
0oM4R 10c4a79
refactor: standardize reward field names and JSON tags in NodeCapacit…
0oM4R e5e481c
fix node tests in client
Eslam-Nawara 2465abc
WIP: add rewards tests in client
0oM4R 2b5f964
remove extra println
Eslam-Nawara 02e4c78
tests: add more test cases for the rewards
0oM4R 6646f65
refactor: standardize reward field names and JSON tags in NodeCapacit…
0oM4R 56109d3
Merge branch 'development_rewards' of github.com:threefoldtech/tfgrid…
0oM4R d0ce507
revert: remove the test file
0oM4R ff3487f
fix: use errors.Is() for proper error comparison in uptime calculatio…
0oM4R b407b77
refactor: replace floating point delta comparisons with exact truncat…
0oM4R cdd305f
test: replace InDelta with Equal for reward distribution percentage c…
0oM4R 6a71bc3
refactor: simplify test assertions using require and assert packages
0oM4R 2ae9121
fix: handle nil response in node rewards request
0oM4R 311f49d
refactor: simplify error handling in node rewards and uptime calculat…
0oM4R b41cddc
Merge branch 'development' of github.com:threefoldtech/tfgridv4-sdk-g…
0oM4R 724b052
lint
0oM4R 036a1b2
refactor: simplify bytes conversion using explicit constants instead …
0oM4R f094176
refactor: consolidate reward calculation into single function with up…
0oM4R acfb746
test: replace assert with require for consistent error checking in re…
0oM4R 9d4fd14
refactor: simplify reward test assertions by comparing entire struct
0oM4R 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
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.
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.