Skip to content

Commit

Permalink
erge branch 'cyr/client' of github.com:CKS-Systems/manifest into cyr/…
Browse files Browse the repository at this point in the history
…client
  • Loading branch information
brittcyr committed Aug 27, 2024
2 parents 8336ea0 + f1a1220 commit bdcda24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions client/idl/generateIdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ function modifyIdlCore(programName) {
}
}

// TODO: Override u128 price in the output for QuoteAtomsPerBaseAtom

for (const idlAccount of idl.accounts) {
if (idlAccount.type && idlAccount.type.fields) {
idlAccount.type.fields = idlAccount.type.fields.map((field) => {
Expand Down
4 changes: 3 additions & 1 deletion client/ts/src/utils/numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export function convertU128(n: bignum): number {
} else {
// can only initialize up to 2**53, but need to divide by 10**20.
const divisor = new BN(10 ** 10);
// TODO: This may lose decimals, so after the first divide, convert to number.
if (n.div(divisor) < new BN(2 ** 53 - 1)) {
return n.div(divisor).toNumber() / 10 ** 10;
}
target = n.div(divisor).div(divisor).toNumber();
}
return target;
Expand Down

0 comments on commit bdcda24

Please sign in to comment.