1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-01-08 07:01:04 +00:00

Remove unused function

This commit is contained in:
Vladimir Volek 2019-02-25 17:23:41 +01:00
parent 885be491d0
commit 6b4b75005b
2 changed files with 0 additions and 28 deletions

View File

@ -10,15 +10,6 @@ describe('format utils', () => {
expect(utils.formatAmount(99999, { isBitcoin: false, shortcut: 'tau' }, null)).toBe('0.00099999 tau');
});
it('format time', () => {
expect(utils.formatTime(0)).toBe('No time estimate');
expect(utils.formatTime(1)).toBe('1 minutes'); // TODO: should be minute
expect(utils.formatTime(2)).toBe('2 minutes');
expect(utils.formatTime(45)).toBe('45 minutes');
expect(utils.formatTime(100)).toBe('1 hour 40 minutes');
expect(utils.formatTime(999)).toBe('16 hours 39 minutes'); // TODO: days, months ????
});
it('btckb2satoshib', () => {
expect(utils.btckb2satoshib(0)).toBe(0);
expect(utils.btckb2satoshib(1)).toBe(100000);

View File

@ -14,25 +14,6 @@ export const formatAmount = (n: number, coinInfo: any, currencyUnits: string = c
return `${s} ${coinInfo.shortcut}`;
};
export const formatTime = (n: number): string => {
const hours = Math.floor(n / 60);
const minutes = n % 60;
if (!n) return 'No time estimate';
let res = '';
if (hours !== 0) {
res += `${hours} hour`;
if (hours > 1) {
res += 's';
}
res += ' ';
}
if (minutes !== 0) {
res += `${minutes} minutes`;
}
return res;
};
export const btckb2satoshib = (n: number): number => Math.round(n * 1e5);
export const stringToHex = (str: string): string => {