-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c246d33
commit d9d4200
Showing
3 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,67 @@ | ||
package grpc | ||
|
||
import ( | ||
"context" | ||
|
||
"google.golang.org/grpc/codes" | ||
"google.golang.org/grpc/status" | ||
|
||
"github.com/elys-network/elys/x/oracle/client" | ||
"github.com/elys-network/elys/x/oracle/types" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
type Querier struct { | ||
Q client.Querier | ||
} | ||
|
||
var _ types.QueryServer = Querier{} | ||
|
||
func (q Querier) PriceAll(grpcCtx context.Context, req *types.QueryAllPriceRequest) (*types.QueryAllPriceResponse, error) { | ||
if req == nil { | ||
return nil, status.Error(codes.InvalidArgument, "empty request") | ||
} | ||
ctx := sdk.UnwrapSDKContext(grpcCtx) | ||
return q.Q.PriceAll(ctx, *req) | ||
} | ||
|
||
// implment those functions | ||
func (q Querier) Params(context.Context, *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { | ||
panic("implement me") | ||
} | ||
|
||
// BandPriceResult defines a rpc handler method for MsgRequestBandPrice. | ||
func (q Querier) BandPriceResult(context.Context, *types.QueryBandPriceRequest) (*types.QueryBandPriceResponse, error) { | ||
panic("implement me") | ||
} | ||
|
||
// LastBandRequestId query the last BandPrice result id | ||
func (q Querier) LastBandRequestId(context.Context, *types.QueryLastBandRequestIdRequest) (*types.QueryLastBandRequestIdResponse, error) { | ||
panic("implement me") | ||
} | ||
|
||
// Queries a AssetInfo by denom. | ||
func (q Querier) AssetInfo(context.Context, *types.QueryGetAssetInfoRequest) (*types.QueryGetAssetInfoResponse, error) { | ||
panic("implement me") | ||
} | ||
|
||
// Queries a list of AssetInfo items. | ||
func (q Querier) AssetInfoAll(context.Context, *types.QueryAllAssetInfoRequest) (*types.QueryAllAssetInfoResponse, error) { | ||
panic("implement me") | ||
} | ||
|
||
// Queries a Price by asset. | ||
func (q Querier) Price(context.Context, *types.QueryGetPriceRequest) (*types.QueryGetPriceResponse, error) { | ||
panic("implement me") | ||
} | ||
|
||
// Queries a PriceFeeder by feeder. | ||
func (q Querier) PriceFeeder(context.Context, *types.QueryGetPriceFeederRequest) (*types.QueryGetPriceFeederResponse, error) { | ||
panic("implement me") | ||
} | ||
|
||
// Queries a list of PriceFeeder items. | ||
func (q Querier) PriceFeederAll(context.Context, *types.QueryAllPriceFeederRequest) (*types.QueryAllPriceFeederResponse, error) { | ||
panic("implement me") | ||
} |
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,19 @@ | ||
package client | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/elys-network/elys/x/oracle/keeper" | ||
"github.com/elys-network/elys/x/oracle/types" | ||
) | ||
|
||
type Querier struct { | ||
K keeper.Keeper | ||
} | ||
|
||
func NewQuerier(k keeper.Keeper) Querier { | ||
return Querier{K: k} | ||
} | ||
|
||
func (q Querier) PriceAll(ctx sdk.Context, req types.QueryAllPriceRequest) (*types.QueryAllPriceResponse, error) { | ||
return q.K.PriceAll(ctx, &req) | ||
} |