Skip to content

Commit b9d1269

Browse files
committed
fix tx.gov tests: fix the construction of weight bignumber
regular expression was removing leading zero and converting the number incorrectly for example: it was converting '0.3' to '300000000000000000'
1 parent 69c426d commit b9d1269

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tx/gov.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export class MsgVoteWeighted implements Msg {
309309
proposal_id: this.params.proposal_id,
310310
options: this.params.options.map((o) => ({
311311
option: o.option,
312-
weight: new BigNumber(o.weight).toFixed(18).replace(/0\.0*/, ""),
312+
weight: new BigNumber(o.weight).toFixed(18),
313313
})),
314314
metadata: this.params.metadata,
315315
};

0 commit comments

Comments
 (0)