Skip to content

Conversation

Shr1ftyy
Copy link
Contributor

@Shr1ftyy Shr1ftyy commented Mar 8, 2025

  • added view attribute to getTotalColdkeyStake and getTotalHotkeyStake functions

Description

These functions in the staking precompile (which I added, and also got recently merged in 😭) cannot be called from within static contexts (i.e. view and pure) functions, even though they do not actually modify state. This PR addresses this issue.

Related Issue(s)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • 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

- added view attribute to getTotalColdkeyStake and getTotalHotkeyStake functions
@sam0x17 sam0x17 requested a review from gztensor March 9, 2025 07:00
Copy link
Contributor

@ales-otf ales-otf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, make this change for both precompile versions.

@ales-otf
Copy link
Contributor

merged via this. thanks!

@ales-otf ales-otf closed this Mar 11, 2025
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.

2 participants