Skip to content

Commit

Permalink
Merge pull request #144 from terra-money/hotfix/gov
Browse files Browse the repository at this point in the history
fix type for deposits and votes
  • Loading branch information
yys authored Sep 30, 2021
2 parents 499a71a + f1dd81f commit 3a3c369
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@terra-money/terra.js",
"version": "2.0.13",
"version": "2.0.14",
"description": "The JavaScript SDK for Terra",
"license": "MIT",
"author": "Terraform Labs, PTE.",
Expand Down
12 changes: 6 additions & 6 deletions src/client/lcd/api/GovAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ export class GovAPI extends BaseAPI {
public async deposits(
proposalId: number,
params: APIParams = {}
): Promise<Deposit> {
): Promise<Deposit[]> {
return this.c
.get<Deposit.Data>(`/gov/proposals/${proposalId}/deposits`, params)
.then(d => Deposit.fromData(d.result));
.get<Deposit.Data[]>(`/gov/proposals/${proposalId}/deposits`, params)
.then(d => d.result.map(Deposit.fromData));
}

/**
Expand All @@ -155,10 +155,10 @@ export class GovAPI extends BaseAPI {
public async votes(
proposalId: number,
params: APIParams = {}
): Promise<Vote> {
): Promise<Vote[]> {
return this.c
.get<Vote.Data>(`/gov/proposals/${proposalId}/votes`, params)
.then(d => Vote.fromData(d.result));
.get<Vote.Data[]>(`/gov/proposals/${proposalId}/votes`, params)
.then(d => d.result.map(Vote.fromData));
}

/**
Expand Down

0 comments on commit 3a3c369

Please sign in to comment.