Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/utils/__tests__/cashMethods.test.js
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
} from '../__mocks__/nullUtxoMocks'; | } from '../__mocks__/nullUtxoMocks'; | ||||
import { | import { | ||||
missingPath1899Wallet, | missingPath1899Wallet, | ||||
missingPublicKeyInPath1899Wallet, | missingPublicKeyInPath1899Wallet, | ||||
missingPublicKeyInPath145Wallet, | missingPublicKeyInPath145Wallet, | ||||
missingPublicKeyInPath245Wallet, | missingPublicKeyInPath245Wallet, | ||||
notLegacyWallet, | notLegacyWallet, | ||||
missingHash160, | |||||
} from '../__mocks__/mockLegacyWalletsUtils'; | } from '../__mocks__/mockLegacyWalletsUtils'; | ||||
import { | import { | ||||
shortCashtabMessageInputHex, | shortCashtabMessageInputHex, | ||||
longCashtabMessageInputHex, | longCashtabMessageInputHex, | ||||
shortExternalMessageInputHex, | shortExternalMessageInputHex, | ||||
longExternalMessageInputHex, | longExternalMessageInputHex, | ||||
shortSegmentedExternalMessageInputHex, | shortSegmentedExternalMessageInputHex, | ||||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | it(`Recognizes a wallet with missing PublicKey in Path145 is a Legacy Wallet and requires migration`, () => { | ||||
true, | true, | ||||
); | ); | ||||
}); | }); | ||||
it(`Recognizes a wallet with missing PublicKey in Path245 is a Legacy Wallet and requires migration`, () => { | it(`Recognizes a wallet with missing PublicKey in Path245 is a Legacy Wallet and requires migration`, () => { | ||||
expect(isLegacyMigrationRequired(missingPublicKeyInPath245Wallet)).toBe( | expect(isLegacyMigrationRequired(missingPublicKeyInPath245Wallet)).toBe( | ||||
true, | true, | ||||
); | ); | ||||
}); | }); | ||||
it(`Recognizes a wallet with missing Hash160 values is a Legacy Wallet and requires migration`, () => { | |||||
expect(isLegacyMigrationRequired(missingHash160)).toBe(true); | |||||
}); | |||||
it(`Recognizes a latest, current wallet that does not require migration`, () => { | it(`Recognizes a latest, current wallet that does not require migration`, () => { | ||||
expect(isLegacyMigrationRequired(notLegacyWallet)).toBe(false); | expect(isLegacyMigrationRequired(notLegacyWallet)).toBe(false); | ||||
}); | }); | ||||
test('toLegacyCash() converts a valid ecash: prefix address to a valid bitcoincash: prefix address', async () => { | test('toLegacyCash() converts a valid ecash: prefix address to a valid bitcoincash: prefix address', async () => { | ||||
const result = toLegacyCash( | const result = toLegacyCash( | ||||
'ecash:qqd3qn4zazjhygk5a2vzw2gvqgqwempr4gtfza25mc', | 'ecash:qqd3qn4zazjhygk5a2vzw2gvqgqwempr4gtfza25mc', | ||||
); | ); | ||||
▲ Show 20 Lines • Show All 603 Lines • Show Last 20 Lines |