-
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
feat: added info for single validator page #15
Conversation
WalkthroughThis update introduces significant changes to the configuration and functionality of the staking module. Key highlights include modifications to environment variable values, the addition of Keybase API integration, and enhancements to validator delegation handling. New schemas, DTOs, and services have been added to support these features, alongside updates to existing enums and interfaces. The changes aim to improve the staking module's capabilities by providing more detailed validator information and integrating external services for enhanced functionality. Changes
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: 3
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (24)
- .env.example (1 hunks)
- src/core/config/config.dto.ts (2 hunks)
- src/core/config/config.schema.ts (1 hunks)
- src/core/config/config.ts (1 hunks)
- src/core/lib/keybase/keybase.service.ts (1 hunks)
- src/core/lib/keybase/responses/failed.response.ts (1 hunks)
- src/core/lib/keybase/responses/generic-success-failed.response.ts (1 hunks)
- src/core/lib/keybase/responses/user-lookup.response.ts (1 hunks)
- src/core/lib/okp4/enums/endpoints.enum.ts (1 hunks)
- src/core/lib/okp4/enums/route-param.enum.ts (1 hunks)
- src/core/lib/okp4/okp4.service.ts (2 hunks)
- src/core/lib/okp4/responses/validator-delegations.response.ts (1 hunks)
- src/modules/staking/dtos/my-validator-delegation.dto.ts (1 hunks)
- src/modules/staking/dtos/validator-delegations.dto.ts (1 hunks)
- src/modules/staking/dtos/validators-view.dto.ts (1 hunks)
- src/modules/staking/enums/query-param.enum.ts (1 hunks)
- src/modules/staking/enums/staking-cache-prefix.enum.ts (1 hunks)
- src/modules/staking/enums/staking-endpoints.enum.ts (1 hunks)
- src/modules/staking/schemas/my-validator-delegation.schema.ts (1 hunks)
- src/modules/staking/schemas/validator-delegations.schema.ts (1 hunks)
- src/modules/staking/services/staking.cache.ts (2 hunks)
- src/modules/staking/services/staking.service.ts (4 hunks)
- src/modules/staking/staking.controller.ts (2 hunks)
- src/modules/staking/staking.module.ts (1 hunks)
Files skipped from review due to trivial changes (8)
- .env.example
- src/core/lib/keybase/responses/generic-success-failed.response.ts
- src/core/lib/okp4/enums/route-param.enum.ts
- src/core/lib/okp4/responses/validator-delegations.response.ts
- src/modules/staking/dtos/my-validator-delegation.dto.ts
- src/modules/staking/dtos/validator-delegations.dto.ts
- src/modules/staking/enums/staking-cache-prefix.enum.ts
- src/modules/staking/schemas/validator-delegations.schema.ts
Additional comments not posted (31)
src/modules/staking/enums/query-param.enum.ts (1)
3-3
: New enum entryVALIDATOR_ADDRESS
looks good and follows the existing naming conventions.src/modules/staking/schemas/my-validator-delegation.schema.ts (1)
1-6
: The Joi schema forMyValidatorDelegationSchema
is well-defined and follows best practices for validation.src/modules/staking/enums/staking-endpoints.enum.ts (1)
3-4
: New enum entriesMY_VALIDATOR_DELEGATION
andVALIDATOR_DELEGATIONS
look good and follow the existing naming conventions.src/modules/staking/dtos/validators-view.dto.ts (1)
2-15
: The new fieldslogo
,description
, andcommission
in theValidatorsViewDto
interface are well-defined and add valuable information.src/core/config/config.dto.ts (1)
7-7
: The new entries forKeybaseConfig
andvalidatorDelegation
inCacheConfig
are well-defined and follow the existing structure and conventions.Also applies to: 35-36, 38-39
src/modules/staking/staking.module.ts (1)
8-8
: Integration ofKeybaseService
looks good.Also applies to: 15-15
src/core/config/config.schema.ts (1)
17-18
: Addition ofSTAKING_VALIDATOR_DELEGATION
andKEYBASE_URL
to the configuration schema looks good.src/core/config/config.ts (1)
25-28
: Addition ofvalidatorDelegation
andkeybase
configuration fields looks good.src/modules/staking/staking.controller.ts (3)
8-11
: Imports forMyValidatorDelegationSchema
,MyValidatorDelegationDto
,ValidatorDelegationsSchema
, andValidatorDelegationsDto
look good.
37-43
: Addition ofgetMyValidatorDelegation
endpoint looks good.
45-51
: Addition ofgetValidatorDelegations
endpoint looks good.src/core/lib/keybase/keybase.service.ts (1)
1-59
: Implementation ofKeybaseService
looks good.src/modules/staking/services/staking.cache.ts (1)
Line range hint
4-81
: Addition of methods for handling validator delegations and images, and modification of existing methods to use the newStakingCachePrefix
enum looks good.src/core/lib/okp4/okp4.service.ts (1)
99-117
: Addition ofgetValidatorDelegations
method looks good.src/modules/staking/services/staking.service.ts (17)
30-36
:onModuleInit
method implementation looks good.
Line range hint
38-50
:getMyStakedOverview
method implementation looks good.
Line range hint
52-65
:fetchAndCacheMyStakedOverview
method implementation looks good.
66-74
:fetchMyStakedAmount
method implementation looks good.
76-78
:fetchDelegatorsValidatorsAmount
method implementation looks good.
82-89
:fetchDelegatorsRewards
method implementation looks good.
Line range hint
91-93
:fetchAvailableBalance
method implementation looks good.
Line range hint
95-107
:getGlobalOverview
method implementation looks good.
Line range hint
109-135
:fetchAndCacheGlobalStakedOverview
method implementation looks good.
Line range hint
136-150
:getValidators
method implementation looks good.
152-155
:fetchAndCacheValidators
method implementation looks good.
156-182
:validatorsView
method implementation looks good.
184-192
:getMyValidatorDelegation
method implementation looks good.
194-208
:fetchAndSaveMyValidatorDelegation
method implementation looks good.
210-224
:getValidatorDelegations
method implementation looks good.
226-233
:validatorDelegationView
method implementation looks good.
234-247
:loadAndCacheValidatorImages
method implementation looks good.
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: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- src/modules/staking/dtos/validators-view.dto.ts (1 hunks)
- src/modules/staking/services/staking.service.ts (4 hunks)
Files skipped from review as they are similar to previous changes (2)
- src/modules/staking/dtos/validators-view.dto.ts
- src/modules/staking/services/staking.service.ts
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: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/modules/staking/services/staking.service.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/modules/staking/services/staking.service.ts
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: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- src/core/lib/okp4/enums/endpoints.enum.ts (1 hunks)
- src/core/lib/okp4/okp4.service.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- src/core/lib/okp4/enums/endpoints.enum.ts
- src/core/lib/okp4/okp4.service.ts
No description provided.