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

Refactor and bugfixing #7

Merged
merged 107 commits into from
Jul 22, 2024
Merged

Refactor and bugfixing #7

merged 107 commits into from
Jul 22, 2024

Conversation

kstepanovdev
Copy link
Collaborator

No description provided.

rustfmt.toml Show resolved Hide resolved
/// * `max_extra_lockup_vote_weight_scaled_factor`: max extra weight for lockups, in 1/1e9 units
/// * `lockup_saturation_secs`: lockup duration at which the full vote weight bonus is given to
/// locked up deposits
/// * `grand_authority`: The keypair that might be an authority for Grand/Clawback
Copy link
Contributor

Choose a reason for hiding this comment

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

It's Grant

Suggested change
/// * `grand_authority`: The keypair that might be an authority for Grand/Clawback
/// * `grant_authority`: The keypair that might be an authority for the Grant/Clawback operation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahah, sure. Didn't notice

/// * B with digit_shift=0, baseline_vote_weight_scaled_factor=1e9,
/// max_extra_lockup_vote_weight_scaled_factor=1e9
/// to not lose precision on B tokens.
/// The vote weight for `amount` of native tokens will be 1:1. Therefore, all active
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment for this method is a bit misleading.

Creates a new exchange rate for a given mint. This allows a voter to ...

doesn't reflect the nature of registering the token that may be used in staking lockups and for voting. This may be both the community and the governance tokens. (Am I getting this last part right?) The operation also persists the grant authority for the specified mint, that will be able to provide grants to other users and may clawback those if the grant terms are violated

@@ -115,14 +99,12 @@ pub fn withdraw(

// Governance may forbid withdraws, for example when engaged in a vote.
// Not applicable for tokens that don't contribute to voting power.
Copy link
Contributor

Choose a reason for hiding this comment

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

This part of the comment is irrelevant to our implementation and should be removed

programs/voter-stake-registry/src/lib.rs Outdated Show resolved Hide resolved
@kstepanovdev kstepanovdev self-assigned this Jul 17, 2024
* initial delegate

* add delegate initial design

* update tests

* update tests && fixtures

* initial delegate

* add delegate initial design

* update fixtures

* remove redundant reprs

* store deposit mining on each creation of deposit entry && add additional validations for stake and extend methods

* update tests

* remove redundant file

* mtg-425: Error handling improvements  (#14)

improved error handling

* initial delegate

* add delegate initial design

* update tests

* update tests && fixtures

* initial delegate

* add delegate initial design

* update fixtures

* remove redundant reprs

* store deposit mining on each creation of deposit entry && add additional validations for stake and extend methods

* update tests

* remove redundant file

* add delegate as a dedicated wallet instead of delegate_mining

* Update program-states/src/state/deposit_entry.rs

Co-authored-by: Stanislav Cherviakov <[email protected]>

* Update programs/voter-stake-registry/src/cpi_instructions.rs

Co-authored-by: Stanislav Cherviakov <[email protected]>

* unify mining verification

* simplify mining verification

* [mtg-308] (#15)

* added change delegate function

* Fixes after rebase

* fix aligment

* Update program-states/src/state/deposit_entry.rs

Co-authored-by: Stanislav Cherviakov <[email protected]>

---------

Co-authored-by: Stanislav Cherviakov <[email protected]>

---------

Co-authored-by: Matiukhin Vlad <[email protected]>
Co-authored-by: Stanislav Cherviakov <[email protected]>
@kstepanovdev kstepanovdev merged commit 6b4a81f into devnet-version Jul 22, 2024
0 of 4 checks passed
@kstepanovdev kstepanovdev deleted the refactor-and-bugfixing branch July 22, 2024 10:39
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.

4 participants