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

Commitment Module Denom Checks #55

Merged
merged 4 commits into from
Apr 20, 2023
Merged

Conversation

AustinoBombino
Copy link
Contributor

Add checks for denoms that can be committed and withdrawn from the commitment module.

Ex:

  • Eden can be committed, Elys cannot
  • Eden-Boost can be committed but not withdrawn

@AustinoBombino AustinoBombino marked this pull request as ready for review April 20, 2023 18:19
"github.com/elys-network/elys/x/commitment/types"
)

func (k msgServer) CommitTokens(goCtx context.Context, msg *types.MsgCommitTokens) (*types.MsgCommitTokensResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

assetProfile, found := k.apKeeper.GetEntry(ctx, msg.Denom)
if !found {
Copy link
Contributor

@kenta-elys kenta-elys Apr 20, 2023

Choose a reason for hiding this comment

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

I couldn't find eden boost in asset profile genesis list. How can we commit it as it isn't listed.

@AustinoBombino AustinoBombino merged commit 6c611e9 into feat/incentive Apr 20, 2023
@AustinoBombino AustinoBombino deleted the fix/commit-checks branch April 20, 2023 18:59
cosmic-vagabond added a commit that referenced this pull request Apr 25, 2023
* add: scaffold incentive

* add: declare incentive params -LP &Stake

* add: implement hook interface functions in incentive module

* add: implement staking hook interface functions in incentive module

* add: add commitmentKeeper as incentive newkeeper param, declare keeper functions for staking hooks

* add: calls appropriate keeper functions ffrom hook functions

* fix: add one more param in calling newkeeper of testutil-incentive.go

* fix: remove exception handling for checking block height in hook functions in order to be succeed in unit test

* feat: add commitment hook and integrated into incentive module

* feat: calculated eden & eden boost uncomitted token amount

* fix: add parms config for incentive module

* fix: refactoring proto define of incentive param

* fix: remove wrongly merged code - double incentive keeper initiate

* fix: rebuild protobuf

* fix: correct data type of incentive params in config.yml and add an exception handling in staking hook ignore 0 block height

* Commitment Module Denom Checks (#55)

* check denom for commit enabled

* commitEnabled config

* withdraw check

* eden-boost assetprofile entry

* fix assetprofile enty decimals

* fix: addcurrent epoch in incentive param and refactoring code baseaccording to the comments

* fix: update getproperincentive param function and handle current epoch number

* fix: add eden boost APR and use it in eden boost calculation

* fix: change function to calculate delegation amount per delegator

* test: 💍 fix test

---------

Co-authored-by: Austin Haines <[email protected]>
Co-authored-by: Cosmic Vagabond <[email protected]>
cosmic-vagabond added a commit that referenced this pull request May 9, 2023
* add: scaffold incentive

* add: declare incentive params -LP &Stake

* add: implement hook interface functions in incentive module

* add: implement staking hook interface functions in incentive module

* add: add commitmentKeeper as incentive newkeeper param, declare keeper functions for staking hooks

* add: calls appropriate keeper functions ffrom hook functions

* fix: add one more param in calling newkeeper of testutil-incentive.go

* fix: remove exception handling for checking block height in hook functions in order to be succeed in unit test

* feat: add commitment hook and integrated into incentive module

* feat: calculated eden & eden boost uncomitted token amount

* fix: add parms config for incentive module

* fix: refactoring proto define of incentive param

* fix: remove wrongly merged code - double incentive keeper initiate

* fix: rebuild protobuf

* fix: correct data type of incentive params in config.yml and add an exception handling in staking hook ignore 0 block height

* Commitment Module Denom Checks (#55)

* check denom for commit enabled

* commitEnabled config

* withdraw check

* eden-boost assetprofile entry

* fix assetprofile enty decimals

* fix: addcurrent epoch in incentive param and refactoring code baseaccording to the comments

* fix: update getproperincentive param function and handle current epoch number

* fix: add eden boost APR and use it in eden boost calculation

* fix: change function to calculate delegation amount per delegator

* feat: add a map to record elys staker and delegators

* feat: add a data map to record elys standard staking

* feat: calculate commission to validator and give it

* feat: update the corresponding commistment to give each validator commissions

* fix: get rid of manual map for recording elys stake info in incentive module

* fix: get rid of manual map to record elys stake, currently havng issue with loading params

* feat: add protos from distribution module

* feat: add query for getting validator outstanding rewards

* feat: add query validator commission

* feat: add query for getting validator slashes

* feat: add query for getting delegation rewards

* feat: dd delegation total rewards

* feat: add a query for getting validators of a delegator

* feat: add community pool query

* feat: add query for getting delegator withdraw address

* feat: add a tx to set withdraw address in incentive module

* feat: add a tx to withdaraw validator commission

* feat: add a tx for withdrawing delegator reward

* feat: finished toten allocation

* feat: finish implementation of queryies and txs

* feat: handle staking hook

* feat: add place holder for converting Elys to USDC

* fix: remove referene to standard distribution module and fix export.go with distribution keeper

* feat: fix genesis paraams of incentive module in config.yml

* fix: update initi genesis and export genesis functions

* fix: fix issue with incentive module genesis initialization and unit testing

* fix: update incentive param initialization to fix unit testing issue

* fix: 🐛 duplicate maccperms

---------

Co-authored-by: Austin Haines <[email protected]>
Co-authored-by: Cosmic Vagabond <[email protected]>
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