Skip to content

Commit

Permalink
wip: param query
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Feb 8, 2022
1 parent 8b6960d commit 2a7aac3
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions x/ecocredit/server/core/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,29 +396,8 @@ func (s serverImpl) CreditTypes(ctx context.Context, _ *v1beta1.QueryCreditTypes
return &v1beta1.QueryCreditTypesResponse{CreditTypes: creditTypes}, nil
}

// Params queries the ecocredit module parameters.
// Add Param query?
// TODO: remove params https://github.com/regen-network/regen-ledger/issues/729
func (s serverImpl) Params(ctx context.Context, _ *v1beta1.QueryParamsRequest) (*v1beta1.QueryParamsResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
var params ecocredit.Params
s.paramSpace.GetParamSet(sdkCtx, &params)
v1beta1types := make([]*v1beta1.CreditType, len(params.CreditTypes))
for i, typ := range params.CreditTypes {
v1beta1types[i] = &v1beta1.CreditType{
Abbreviation: typ.Abbreviation,
Name: typ.Name,
Unit: typ.Unit,
Precision: typ.Precision,
}
}
v1beta1Params := v1beta1.Params{
CreditClassFee: params.CreditClassFee,
AllowedClassCreators: params.AllowedClassCreators,
AllowlistEnabled: params.AllowlistEnabled,
CreditTypes: v1beta1types,
}
return &v1beta1.QueryParamsResponse{Params: &v1beta1Params}, nil
}

// SellOrder queries for information about a sell order by its ID
// TODO: impl with ORM https://github.com/regen-network/regen-ledger/issues/728
Expand Down

0 comments on commit 2a7aac3

Please sign in to comment.