Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
fix(lsk): normalise vote amount
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian committed Jul 11, 2021
1 parent 2364757 commit 6ee47ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-lsk/source/client-three.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe("ClientService", () => {
expect(result.votes).toMatchInlineSnapshot(`
Array [
Object {
"amount": "307554000000000",
"amount": 3075540,
"id": "lskbps7ge5n9y7f8nk4222c77zkqcntrj7jyhmkwp",
},
]
Expand Down
6 changes: 4 additions & 2 deletions packages/sdk-lsk/source/client-three.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { getAddressFromBase32Address } from "@liskhq/lisk-cryptography";
import { Collections, Contracts, Helpers, IoC, Services } from "@payvo/sdk";

@IoC.injectable()
export class ClientService extends Services.AbstractClientService {
#peer!: string;

@IoC.inject(IoC.BindingType.BigNumberService)
protected readonly bigNumberService!: Services.BigNumberService;

@IoC.postConstruct()
private onPostConstruct(): void {
this.#peer = `${Helpers.randomHostFromConfig(this.configRepository, "archival")}/api/v2`;
Expand Down Expand Up @@ -70,7 +72,7 @@ export class ClientService extends Services.AbstractClientService {
available: 20 - data.account.votesUsed,
votes: data.votes.map(({ address, amount }) => ({
id: address,
amount,
amount: this.bigNumberService.make(amount).toHuman(),
})),
};
}
Expand Down

0 comments on commit 6ee47ff

Please sign in to comment.