-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Perpetual]: Update checksameassetposition function (#576) * [Bug]: Fix calculate discount and add more tests (#570) * add calculate discount test and bug fix * get asset by denom * ci: use post-upgrade-snapshot-generator (#571) * ci: use post-upgrade-snapshot-generator * ci: update delete snapshot CI to use post upgrade snapshot gen binary * update checksame position * update tests * add comment --------- Co-authored-by: Cosmic Vagabond <[email protected]> * ci: clean up upgrade handler (#573) * [Bug]: Fix calculate discount and add more tests (#570) * add calculate discount test and bug fix * get asset by denom * ci: use post-upgrade-snapshot-generator (#571) * ci: use post-upgrade-snapshot-generator * ci: update delete snapshot CI to use post upgrade snapshot gen binary * ci: clean up upgrade handler * ci: use latest post upgrade snapshot gen version * ci: update post upgrade snapshot gen version * ci: cache snapshot * ci: use latest version of snapshot gen * ci: trigger software upgrade test and unit tests for develop, devnet and main branches --------- Co-authored-by: Amit Yadav <[email protected]> * Leveragelp rewards claim fix (#577) * fix leveragelp rewards query and claim fix * incremenet version --------- Co-authored-by: Warao <[email protected]> * Halborn finding fixes (#572) * [Bug]: Fix calculate discount and add more tests (#570) * add calculate discount test and bug fix * get asset by denom * ci: use post-upgrade-snapshot-generator (#571) * ci: use post-upgrade-snapshot-generator * ci: update delete snapshot CI to use post upgrade snapshot gen binary * halborn finding fixes * fix masterchef external incentive add * resolve tests --------- Co-authored-by: Amit Yadav <[email protected]> Co-authored-by: Cosmic Vagabond <[email protected]> * add total leveragelp position query * handle logic * fix * decimal fix * remove realtime * update * reduce args * update * changes * delete file * update --------- Co-authored-by: Amit Yadav <[email protected]> Co-authored-by: jelysn <[email protected]> Co-authored-by: Warao <[email protected]>
- Loading branch information
1 parent
c3dc7a9
commit 84cf732
Showing
14 changed files
with
685 additions
and
113 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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,45 @@ | ||
package cli | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/flags" | ||
"github.com/elys-network/elys/x/tier/types" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var _ = strconv.Itoa(0) | ||
|
||
func CmdLeverageLpTotal() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "leverage-lp-total [user]", | ||
Short: "Query leverage-lp-total", | ||
Args: cobra.ExactArgs(1), | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
reqUser := args[0] | ||
|
||
clientCtx, err := client.GetClientQueryContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
queryClient := types.NewQueryClient(clientCtx) | ||
|
||
params := &types.QueryLeverageLpTotalRequest{ | ||
User: reqUser, | ||
} | ||
|
||
res, err := queryClient.LeverageLpTotal(cmd.Context(), params) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return clientCtx.PrintProto(res) | ||
}, | ||
} | ||
|
||
flags.AddQueryFlagsToCmd(cmd) | ||
|
||
return cmd | ||
} |
This file contains 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 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 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,24 @@ | ||
package keeper | ||
|
||
import ( | ||
"context" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/elys-network/elys/x/tier/types" | ||
"google.golang.org/grpc/codes" | ||
"google.golang.org/grpc/status" | ||
) | ||
|
||
func (k Keeper) LeverageLpTotal(goCtx context.Context, req *types.QueryLeverageLpTotalRequest) (*types.QueryLeverageLpTotalResponse, error) { | ||
if req == nil { | ||
return nil, status.Error(codes.InvalidArgument, "invalid request") | ||
} | ||
|
||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
sender := sdk.MustAccAddressFromBech32(req.User) | ||
total := k.RetreiveLeverageLpTotal(ctx, sender) | ||
|
||
return &types.QueryLeverageLpTotalResponse{ | ||
Total: total, | ||
}, nil | ||
} |
Oops, something went wrong.