@Test public void testMnemonicBadWordException() { thrown.expect(TokenException.class); thrown.expectMessage(Messages.MNEMONIC_BAD_WORD); String test = "hot zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong"; List<String> mnemonic = Arrays.asList(test.split(" ")); MnemonicUtil.validateMnemonics(mnemonic); fail("Should throw a exception"); }
public static void validateMnemonics(List<String> mnemonicCodes) { try { MnemonicCode.INSTANCE.check(mnemonicCodes); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicLengthException e) { throw new TokenException(Messages.MNEMONIC_INVALID_LENGTH); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicWordException e) { throw new TokenException(Messages.MNEMONIC_BAD_WORD); } catch (Exception e) { throw new TokenException(Messages.MNEMONIC_CHECKSUM); } }
MnemonicUtil { public static void validateMnemonics(List<String> mnemonicCodes) { try { MnemonicCode.INSTANCE.check(mnemonicCodes); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicLengthException e) { throw new TokenException(Messages.MNEMONIC_INVALID_LENGTH); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicWordException e) { throw new TokenException(Messages.MNEMONIC_BAD_WORD); } catch (Exception e) { throw new TokenException(Messages.MNEMONIC_CHECKSUM); } } }
MnemonicUtil { public static void validateMnemonics(List<String> mnemonicCodes) { try { MnemonicCode.INSTANCE.check(mnemonicCodes); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicLengthException e) { throw new TokenException(Messages.MNEMONIC_INVALID_LENGTH); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicWordException e) { throw new TokenException(Messages.MNEMONIC_BAD_WORD); } catch (Exception e) { throw new TokenException(Messages.MNEMONIC_CHECKSUM); } }  }
MnemonicUtil { public static void validateMnemonics(List<String> mnemonicCodes) { try { MnemonicCode.INSTANCE.check(mnemonicCodes); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicLengthException e) { throw new TokenException(Messages.MNEMONIC_INVALID_LENGTH); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicWordException e) { throw new TokenException(Messages.MNEMONIC_BAD_WORD); } catch (Exception e) { throw new TokenException(Messages.MNEMONIC_CHECKSUM); } }  static void validateMnemonics(List<String> mnemonicCodes); static List<String> randomMnemonicCodes(); }
MnemonicUtil { public static void validateMnemonics(List<String> mnemonicCodes) { try { MnemonicCode.INSTANCE.check(mnemonicCodes); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicLengthException e) { throw new TokenException(Messages.MNEMONIC_INVALID_LENGTH); } catch (org.bitcoinj.crypto.MnemonicException.MnemonicWordException e) { throw new TokenException(Messages.MNEMONIC_BAD_WORD); } catch (Exception e) { throw new TokenException(Messages.MNEMONIC_CHECKSUM); } }  static void validateMnemonics(List<String> mnemonicCodes); static List<String> randomMnemonicCodes();  }