Skip to content
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

[staking] refactor statereader to support multiple contract indexers #4255

Merged
merged 7 commits into from
Jun 6, 2024

Conversation

envestcc
Copy link
Member

@envestcc envestcc commented Apr 24, 2024

Description

This refactoring will simplify the integration work of the coming new staking contract indexer, with the main changes including:

  • removing CandidateVotes() from the indexer interface, with vote counting implementation move to the staking protocol
  • adding ContractAddress() in the indexer interface
  • introducing []indexers in statereader, and implementation of various read interfaces based on it.

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • Code refactor or improvement

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

action/protocol/staking/protocol.go Outdated Show resolved Hide resolved
action/protocol/staking/staking_statereader.go Outdated Show resolved Hide resolved
@envestcc envestcc force-pushed the pr-refactstaking branch from a86d812 to 2acc541 Compare June 6, 2024 01:58
Copy link

sonarqubecloud bot commented Jun 6, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
4.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@envestcc envestcc merged commit 8ad9c9c into iotexproject:master Jun 6, 2024
2 of 3 checks passed
@envestcc envestcc deleted the pr-refactstaking branch June 6, 2024 02:45
@envestcc envestcc restored the pr-refactstaking branch June 26, 2024 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants