-
Notifications
You must be signed in to change notification settings - Fork 64
Farm token #706
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
Open
vishnukumavat
wants to merge
17
commits into
feature/dev
Choose a base branch
from
farm_token
base: feature/dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Farm token #706
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
eda2a67
mint/burn mechanism added for farm coins
vishnukumavat f842ab5
coin denom change in message unfarm
vishnukumavat 70608c7
new test cases added for farm-unfarm
vishnukumavat 50a39ff
ownership validator for farm coin added
vishnukumavat 72880b7
ownership transfer handler added
vishnukumavat 09546c8
farm coin in poools query
vishnukumavat 876d877
farm coin decimal check
vishnukumavat 28967f9
transfers block - farm coins
vishnukumavat daf4055
test token list update
vishnukumavat 25191d2
Merge remote-tracking branch 'origin/feature/dev' into farm_token
vishnukumavat 74349bb
typo fix
vishnukumavat 38ba22d
Merge remote-tracking branch 'origin/feature/dev' into farm_token
vishnukumavat fac0823
liquidity modules's migration
vishnukumavat 7ea6eee
liquidity migration code update
vishnukumavat 8437136
amount check before mint in migration
vishnukumavat 9e6008e
farm validation and ownership transfer added in vault and auction
vishnukumavat c01cc84
Merge remote-tracking branch 'origin/feature/dev' into farm_token
vishnukumavat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -224,6 +224,8 @@ message PoolResponse { | |
|
|
||
| bool disabled = 15; | ||
|
|
||
| FarmCoin farm_coin = 16; | ||
|
|
||
| } | ||
|
|
||
| message PoolBalances { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package keeper | ||
|
|
||
| import ( | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" | ||
| ) | ||
|
|
||
| func (k Keeper) IsCoinTransferBlocked(ctx sdk.Context, coin sdk.Coin) bool { | ||
| return !k.bankKeeper.IsSendEnabledCoin(ctx, coin) | ||
| } | ||
|
|
||
| func (k Keeper) BlockCoinTransferIfNotAlready(ctx sdk.Context, coin sdk.Coin) { | ||
| if !k.IsCoinTransferBlocked(ctx, coin) { | ||
| bankParams := k.bankKeeper.GetParams(ctx) | ||
| bankParams.SendEnabled = append(bankParams.SendEnabled, | ||
| banktypes.NewSendEnabled(coin.Denom, false), | ||
| ) | ||
| k.bankKeeper.SetParams(ctx, bankParams) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package keeper_test | ||
|
|
||
| import ( | ||
| utils "github.com/comdex-official/comdex/types" | ||
| _ "github.com/stretchr/testify/suite" | ||
| ) | ||
|
|
||
| func (s *KeeperTestSuite) TestBlockCoinTransferIfNotAlready() { | ||
| coin1 := utils.ParseCoin("1000coin1") | ||
| isBlocked := s.keeper.IsCoinTransferBlocked(s.ctx, coin1) | ||
| s.Require().False(isBlocked) | ||
| s.keeper.BlockCoinTransferIfNotAlready(s.ctx, coin1) | ||
| isBlocked = s.keeper.IsCoinTransferBlocked(s.ctx, coin1) | ||
| s.Require().True(isBlocked) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.