-
Notifications
You must be signed in to change notification settings - Fork 51
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 <121588426+cosmic-vagabond@users.noreply.github.com> * 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 <amy29981@gmail.com> * Leveragelp rewards claim fix (#577) * fix leveragelp rewards query and claim fix * incremenet version --------- Co-authored-by: Warao <wari@elys.network> * 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 <amy29981@gmail.com> Co-authored-by: Cosmic Vagabond <121588426+cosmic-vagabond@users.noreply.github.com> * 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 <amy29981@gmail.com> Co-authored-by: jelysn <129082781+jelysn@users.noreply.github.com> Co-authored-by: Warao <wari@elys.network>
- Loading branch information
1 parent
e699b0a
commit 0abb916
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.