-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: updated bonded tokens formula #37
Conversation
WalkthroughSeveral new changes have been introduced to enhance the staking functionality. A new endpoint Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant StakingService
participant Okp4Service
participant Endpoints
participant StakingPoolResponse
Client->>StakingService: requestStakingInfo()
StakingService->>Okp4Service: getStakingPool()
Okp4Service->>Endpoints: STAKING_POOL
Endpoints-->>Okp4Service: Send pool endpoint
Okp4Service->>StakingPoolResponse: fetchData()
StakingPoolResponse-->>Okp4Service: Return pool data
Okp4Service-->>StakingService: Return StakingPoolResponse
StakingService-->>Client: Send updated staking info
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
Outside diff range and nitpick comments (2)
src/core/lib/okp4/okp4.service.ts (1)
Line range hint
172-173
: Consider using optional chaining to improve code safety and readability.- if (status) { + if (status?) {src/modules/staking/services/staking.service.ts (1)
Line range hint
474-474
: Consider using optional chaining to improve code safety and readability.- if (cache === null) { + if (cache?) {
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- src/core/lib/okp4/enums/endpoints.enum.ts (1 hunks)
- src/core/lib/okp4/okp4.service.ts (3 hunks)
- src/core/lib/okp4/responses/staking-pool.response.ts (1 hunks)
- src/modules/staking/services/staking.service.ts (2 hunks)
Additional context used
Biome
src/core/lib/okp4/okp4.service.ts
[error] 172-173: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
src/modules/staking/services/staking.service.ts
[error] 474-474: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
Additional comments not posted (5)
src/core/lib/okp4/responses/staking-pool.response.ts (1)
1-6
: TheStakingPoolResponse
interface is well-defined and correctly encapsulates thepool
object withnot_bonded_tokens
andbonded_tokens
.src/core/lib/okp4/enums/endpoints.enum.ts (1)
15-15
: The addition of theSTAKING_POOL
endpoint is correct and aligns well with the existing structure of theEndpoints
enum.src/core/lib/okp4/okp4.service.ts (2)
26-26
: The import ofStakingPoolResponse
is appropriately placed and necessary for the new functionality.
245-247
: ThegetStakingPool
method is correctly implemented to fetch staking pool data using the new endpoint. Good use of existing infrastructure for error handling and URL construction.src/modules/staking/services/staking.service.ts (1)
158-158
: Correct integration of thegetStakingPool
method within thefetchAndCacheGlobalStakedOverview
function.
No description provided.