Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxySciTech committed Jul 5, 2020
1 parent 430955b commit 7ade477
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
25 changes: 0 additions & 25 deletions src/main/java/org/consenlabs/tokencore/wallet/Identity.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ public List<Wallet> deriveWallets(List<String> chainTypes, String password) {
case ChainType.LITECOIN:
wallet = deriveLitecoinWallet(mnemonics, password, this.getMetadata().getSegWit());
break;
case ChainType.USDT:
wallet = deriveUSDTWallet(mnemonics, password, this.getMetadata().getSegWit());
break;
case ChainType.EOS:
wallet = deriveEOSWallet(mnemonics, password);
break;
Expand All @@ -187,9 +184,6 @@ public List<Wallet> deriveWalletsByMnemonics(List<String> chainTypes, String pas
case ChainType.ETHEREUM:
wallet = deriveEthereumWallet(mnemonics, password);
break;
case ChainType.USDT:
wallet = deriveUSDTWallet(mnemonics, password, this.getMetadata().getSegWit());
break;
case ChainType.LITECOIN:
wallet = deriveLitecoinWallet(mnemonics, password, this.getMetadata().getSegWit());
break;
Expand Down Expand Up @@ -253,25 +247,6 @@ private Wallet deriveBitcoinWallet(List<String> mnemonicCodes, String password,
return WalletManager.createWallet(keystore);
}

private Wallet deriveUSDTWallet(List<String> mnemonicCodes, String password, String segWit) {
Metadata walletMetadata = new Metadata();
walletMetadata.setChainType(ChainType.USDT);
walletMetadata.setPasswordHint(this.getMetadata().getPasswordHint());
walletMetadata.setSource(this.getMetadata().getSource());
walletMetadata.setNetwork(this.getMetadata().getNetwork());
walletMetadata.setName("USDT");
walletMetadata.setSegWit(segWit);
String path;
if (Metadata.P2WPKH.equals(segWit)) {
path = this.getMetadata().isMainNet() ? BIP44Util.BITCOIN_SEGWIT_MAIN_PATH : BIP44Util.BITCOIN_SEGWIT_TESTNET_PATH;
} else {
path = this.getMetadata().isMainNet() ? BIP44Util.BITCOIN_MAINNET_PATH : BIP44Util.BITCOIN_TESTNET_PATH;
}

IMTKeystore keystore = HDMnemonicKeystore.create(walletMetadata, password, mnemonicCodes, path);
return WalletManager.createWallet(keystore);
}

private Wallet deriveLitecoinWallet(List<String> mnemonics, String password, String segWit) {
Metadata walletMetadata = new Metadata();
walletMetadata.setChainType(ChainType.LITECOIN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ public class ChainType {
public final static String BITCOIN = "BITCOIN";
public final static String EOS = "EOS";
public final static String LITECOIN = "LITECOIN";
public final static String USDT = "USDT";
public final static String DASH = "DASH";


public static void validate(String type) {
if (!ETHEREUM.equals(type) && !BITCOIN.equals(type) && !EOS.equals(type)&&!LITECOIN.equals(type)&&!USDT.equals(type)&&!DASH.equals(type)) {
if (!ETHEREUM.equals(type) && !BITCOIN.equals(type) && !EOS.equals(type)&&!LITECOIN.equals(type)&&!DASH.equals(type)) {
throw new TokenException(Messages.WALLET_INVALID_TYPE);
}
}
Expand Down

0 comments on commit 7ade477

Please sign in to comment.