Skip to content

Commit 3c5cc96

Browse files
committed
fix: update xrpToken decimals
TICKET: WIN-4470
1 parent 7bad535 commit 3c5cc96

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

modules/bitgo/test/v2/unit/coins/ofcToken.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const PRECISION_6 = '1000000';
77
const PRECISION_7 = '10000000';
88
const PRECISION_8 = '100000000';
99
const PRECISION_9 = '1000000000';
10+
const PRECISION_15 = '1000000000000000';
1011
const PRECISION_18 = '1000000000000000000';
11-
const PRECISION_96 = '9.999999999999999e+95';
1212

1313
describe('OFC:', function () {
1414
let bitgo;
@@ -429,15 +429,15 @@ describe('OFC:', function () {
429429
const ofcCoin = bitgo.coin(tokenMain);
430430
ofcCoin.getChain().should.equal(tokenMain);
431431
ofcCoin.getFullName().should.equal('Ripple USD');
432-
ofcCoin.getBaseFactor().should.equal(PRECISION_96);
432+
ofcCoin.getBaseFactor().should.equal(PRECISION_15);
433433
});
434434
});
435435
describe('for test network', function () {
436436
it(`should have the correct values for ${tokenTest}`, function () {
437437
const ofcCoin = bitgo.coin(tokenTest);
438438
ofcCoin.getChain().should.equal(tokenTest);
439439
ofcCoin.getFullName().should.equal('RLUSD');
440-
ofcCoin.getBaseFactor().should.equal(PRECISION_96);
440+
ofcCoin.getBaseFactor().should.equal(PRECISION_15);
441441
});
442442
});
443443
});

modules/sdk-coin-xrp/src/xrpToken.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ export class XrpToken extends Xrp {
6565
}
6666

6767
getBaseFactor(): number {
68-
return 1e96;
68+
return Math.pow(10, this.tokenConfig.decimalPlaces);
6969
}
7070
}

modules/sdk-coin-xrp/test/unit/transactionBuilder/tokenTransferBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('XRP Token Transfer Builder', () => {
88

99
it('should build a token transfer', async function () {
1010
const txBuilder = factory.getTokenTransferBuilder();
11-
const amount = (BigInt(25) * BigInt(10) ** BigInt(96)).toString();
11+
const amount = '25000000000000000';
1212

1313
txBuilder.to(testData.TEST_SINGLE_SIG_ACCOUNT.address);
1414
txBuilder.amount(amount);

modules/sdk-coin-xrp/test/unit/transactionBuilder/trustSetBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('XRP Trustline Builder', () => {
88

99
it('should build a TrustSet transaction', async function () {
1010
const txBuilder = factory.getTrustSetBuilder();
11-
const amount = (BigInt(1000000000000) * BigInt(10) ** BigInt(96)).toString();
11+
const amount = '1000000000000000000000000000';
1212

1313
txBuilder.sender(utils.getAddressDetails(testData.TEST_MULTI_SIG_ACCOUNT.address).address);
1414
txBuilder.amount(amount);

modules/sdk-coin-xrp/test/unit/xrpToken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ describe('Xrp Tokens', function () {
2222
xrpTokenCoin.getChain().should.equal(tokenName);
2323
xrpTokenCoin.getBaseChain().should.equal('txrp');
2424
xrpTokenCoin.getFullName().should.equal('Xrp Token');
25-
xrpTokenCoin.getBaseFactor().should.equal(1e96);
25+
xrpTokenCoin.getBaseFactor().should.equal(1000000000000000);
2626
xrpTokenCoin.type.should.equal(tokenName);
2727
xrpTokenCoin.name.should.equal('RLUSD');
2828
xrpTokenCoin.coin.should.equal('txrp');
2929
xrpTokenCoin.network.should.equal('Testnet');
30-
xrpTokenCoin.decimalPlaces.should.equal(96);
30+
xrpTokenCoin.decimalPlaces.should.equal(15);
3131
});
3232
});

modules/statics/src/coins.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,8 +2028,8 @@ export const coins = CoinMap.fromCoins([
20282028
),
20292029
tofcTronToken('937efe97-a17a-4d2a-aaf2-0ffdb529a943', 'ofcttrx:usdt', 'Tether USD', 6, UnderlyingAsset['ttrx:usdt']),
20302030
ofcTronToken('94b00b66-68a4-45ed-b772-77e5bca1e34c', 'ofctrx:usdt', 'Tether USD', 6, UnderlyingAsset['trx:usdt']),
2031-
ofcXrpToken('6a173023-5faf-4a0a-af38-b8be98abe94f', 'ofcxrp:rlusd', 'Ripple USD', 96, UnderlyingAsset['xrp:rlusd']),
2032-
tofcXrpToken('bd406dab-3b55-4ab5-b0a5-74b9f94268a3', 'ofctxrp:rlusd', 'RLUSD', 96, UnderlyingAsset['txrp:rlusd']),
2031+
ofcXrpToken('6a173023-5faf-4a0a-af38-b8be98abe94f', 'ofcxrp:rlusd', 'Ripple USD', 15, UnderlyingAsset['xrp:rlusd']),
2032+
tofcXrpToken('bd406dab-3b55-4ab5-b0a5-74b9f94268a3', 'ofctxrp:rlusd', 'RLUSD', 15, UnderlyingAsset['txrp:rlusd']),
20332033
ofc('837f0cab-cad1-4510-a8e4-f2c60e1a8760', 'ofcusd', 'USD', 2, UnderlyingAsset.USD, CoinKind.FIAT),
20342034
ofc('798f2a7c-23fd-4e16-9fe5-6bf47ca438a0', 'ofceur', 'Euro', 2, UnderlyingAsset.EUR, CoinKind.FIAT),
20352035
ofc('f37bbb72-adfe-4d06-90dc-afd0aa34aadd', 'ofcgbp', 'Pound Sterling', 2, UnderlyingAsset.GBP, CoinKind.FIAT),
@@ -20438,7 +20438,7 @@ export const coins = CoinMap.fromCoins([
2043820438
'4c472d5f-0b9f-4086-9ff6-dcce51fce7fc',
2043920439
'txrp:rlusd',
2044020440
'RLUSD',
20441-
96,
20441+
15,
2044220442
'rQhWct2fv4Vc4KRjRgMrxa8xPN9Zx9iLKV',
2044320443
'524C555344000000000000000000000000000000',
2044420444
'ripple.com',
@@ -20448,7 +20448,7 @@ export const coins = CoinMap.fromCoins([
2044820448
'a5e3e409-4cde-443d-9000-22bfc99ad456',
2044920449
'xrp:rlusd',
2045020450
'Ripple USD',
20451-
96,
20451+
15,
2045220452
'rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De',
2045320453
'524C555344000000000000000000000000000000',
2045420454
'ripple.com',
@@ -20458,7 +20458,7 @@ export const coins = CoinMap.fromCoins([
2045820458
'155818c4-efda-4758-bb25-37c093b6dc02',
2045920459
'txrp:xat',
2046020460
'XRP ATL Token',
20461-
96,
20461+
15,
2046220462
'rHy7UVhwM7Xgo4SoUTf5hE5yWKZKPEkxcL',
2046320463
'5841540000000000000000000000000000000000',
2046420464
'xat.com',

0 commit comments

Comments
 (0)