sdk38: Rename gov.parameters
This commit is contained in:
parent
a00c5e8f8d
commit
c5cc8fd0db
@ -29,7 +29,7 @@ export {
|
||||
BroadcastMode,
|
||||
EncodeTxResponse,
|
||||
GovExtension,
|
||||
GovParametersByTypeResponse,
|
||||
GovParametersResponse,
|
||||
GovProposalsResponse,
|
||||
GovProposalResponse,
|
||||
GovProposerResponse,
|
||||
|
||||
@ -109,12 +109,12 @@ describe("GovExtension", () => {
|
||||
}
|
||||
});
|
||||
|
||||
describe("parametersByType", () => {
|
||||
describe("parameters", () => {
|
||||
it("works for deposit", async () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = makeGovClient(wasmd.endpoint);
|
||||
const paramsType = GovParametersType.Deposit;
|
||||
const response = await client.gov.parametersByType(paramsType);
|
||||
const response = await client.gov.parameters(paramsType);
|
||||
expect(response).toEqual({
|
||||
height: jasmine.stringMatching(nonNegativeIntegerMatcher),
|
||||
result: {
|
||||
@ -128,7 +128,7 @@ describe("GovExtension", () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = makeGovClient(wasmd.endpoint);
|
||||
const paramsType = GovParametersType.Tallying;
|
||||
const response = await client.gov.parametersByType(paramsType);
|
||||
const response = await client.gov.parameters(paramsType);
|
||||
expect(response).toEqual({
|
||||
height: jasmine.stringMatching(nonNegativeIntegerMatcher),
|
||||
result: {
|
||||
@ -143,7 +143,7 @@ describe("GovExtension", () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = makeGovClient(wasmd.endpoint);
|
||||
const paramsType = GovParametersType.Voting;
|
||||
const response = await client.gov.parametersByType(paramsType);
|
||||
const response = await client.gov.parameters(paramsType);
|
||||
expect(response).toEqual({
|
||||
height: jasmine.stringMatching(nonNegativeIntegerMatcher),
|
||||
result: {
|
||||
|
||||
@ -31,7 +31,7 @@ export interface GovParametersVotingResponse {
|
||||
};
|
||||
}
|
||||
|
||||
export type GovParametersByTypeResponse =
|
||||
export type GovParametersResponse =
|
||||
| GovParametersDepositResponse
|
||||
| GovParametersTallyingResponse
|
||||
| GovParametersVotingResponse;
|
||||
@ -118,7 +118,7 @@ export interface GovVoteResponse {
|
||||
|
||||
export interface GovExtension {
|
||||
readonly gov: {
|
||||
readonly parametersByType: (parametersType: GovParametersType) => Promise<GovParametersByTypeResponse>;
|
||||
readonly parameters: (parametersType: GovParametersType) => Promise<GovParametersResponse>;
|
||||
readonly proposals: () => Promise<GovProposalsResponse>;
|
||||
readonly proposal: (proposalId: string) => Promise<GovProposalResponse>;
|
||||
readonly proposer: (proposalId: string) => Promise<GovProposerResponse>;
|
||||
@ -133,8 +133,7 @@ export interface GovExtension {
|
||||
export function setupGovExtension(base: LcdClient): GovExtension {
|
||||
return {
|
||||
gov: {
|
||||
parametersByType: async (parametersType: GovParametersType) =>
|
||||
base.get(`/gov/parameters/${parametersType}`),
|
||||
parameters: async (parametersType: GovParametersType) => base.get(`/gov/parameters/${parametersType}`),
|
||||
proposals: async () => base.get("/gov/proposals"),
|
||||
proposal: async (proposalId: string) => base.get(`/gov/proposals/${proposalId}`),
|
||||
proposer: async (proposalId: string) => base.get(`/gov/proposals/${proposalId}/proposer`),
|
||||
|
||||
@ -6,7 +6,7 @@ export { AuthExtension, AuthAccountsResponse, setupAuthExtension } from "./auth"
|
||||
export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank";
|
||||
export {
|
||||
GovExtension,
|
||||
GovParametersByTypeResponse,
|
||||
GovParametersResponse,
|
||||
GovProposalsResponse,
|
||||
GovProposalResponse,
|
||||
GovProposerResponse,
|
||||
|
||||
2
packages/sdk38/types/index.d.ts
vendored
2
packages/sdk38/types/index.d.ts
vendored
@ -27,7 +27,7 @@ export {
|
||||
BroadcastMode,
|
||||
EncodeTxResponse,
|
||||
GovExtension,
|
||||
GovParametersByTypeResponse,
|
||||
GovParametersResponse,
|
||||
GovProposalsResponse,
|
||||
GovProposalResponse,
|
||||
GovProposerResponse,
|
||||
|
||||
4
packages/sdk38/types/lcdapi/gov.d.ts
vendored
4
packages/sdk38/types/lcdapi/gov.d.ts
vendored
@ -26,7 +26,7 @@ export interface GovParametersVotingResponse {
|
||||
readonly voting_period: string;
|
||||
};
|
||||
}
|
||||
export declare type GovParametersByTypeResponse =
|
||||
export declare type GovParametersResponse =
|
||||
| GovParametersDepositResponse
|
||||
| GovParametersTallyingResponse
|
||||
| GovParametersVotingResponse;
|
||||
@ -100,7 +100,7 @@ export interface GovVoteResponse {
|
||||
}
|
||||
export interface GovExtension {
|
||||
readonly gov: {
|
||||
readonly parametersByType: (parametersType: GovParametersType) => Promise<GovParametersByTypeResponse>;
|
||||
readonly parameters: (parametersType: GovParametersType) => Promise<GovParametersResponse>;
|
||||
readonly proposals: () => Promise<GovProposalsResponse>;
|
||||
readonly proposal: (proposalId: string) => Promise<GovProposalResponse>;
|
||||
readonly proposer: (proposalId: string) => Promise<GovProposerResponse>;
|
||||
|
||||
2
packages/sdk38/types/lcdapi/index.d.ts
vendored
2
packages/sdk38/types/lcdapi/index.d.ts
vendored
@ -2,7 +2,7 @@ export { AuthExtension, AuthAccountsResponse, setupAuthExtension } from "./auth"
|
||||
export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank";
|
||||
export {
|
||||
GovExtension,
|
||||
GovParametersByTypeResponse,
|
||||
GovParametersResponse,
|
||||
GovProposalsResponse,
|
||||
GovProposalResponse,
|
||||
GovProposerResponse,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user