Skip to content

Commit 7f40845

Browse files
authored
Merge pull request #452 from persistenceOne/passphrase
Passphrase fix
2 parents 86a63d3 + eaffa89 commit 7f40845

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pwallet",
3-
"version": "2.1.4",
3+
"version": "3.1.1",
44
"private": true,
55
"dependencies": {
66
"@cosmjs/crypto": "^v0.27.1",

src/components/DarkMode/global.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ export const GlobalStyles = createGlobalStyle`
230230
.MuiPaper-root.MuiMenu-paper .validator-item, .MuiListItem-root.Mui-selected, .MuiListItem-root.Mui-selected:hover, .MuiMenuItem-root{
231231
border-bottom: 1px solid ${({theme}) => theme.selectItemBorderColor} !important;
232232
color: ${({theme}) => theme.infoHeadingColor};
233+
};
234+
.modal-content .form-check label{
235+
color: ${({theme}) => theme.selectIconColor};
233236
}
234-
235237
`;

src/containers/SignIn/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const SignIn = (props) => {
5353

5454
const cosmos = ExternalChains.find(chain => chain.chainName === 'Cosmos');
5555

56-
console.log(cosmos, "Cosmos");
5756
return (
5857
<>
5958
<Modal backdrop="static" show={show} onHide={handleClose} centered

src/store/actions/transactions/keyStore.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ export const keyStoreSubmit = (loginAddress) => {
4545
const loginInfo = JSON.parse(localStorage.getItem(LOGIN_INFO));
4646
const password = getState().keyStore.password;
4747
const keyStoreData = getState().keyStore.keyStore;
48+
const encryptedSeed = getState().common.loginInfo.encryptedSeed;
49+
4850
let loginCoinType;
49-
if (loginInfo && loginInfo?.addressLogin){
51+
if ((loginInfo && loginInfo?.addressLogin) || (loginInfo && !encryptedSeed)){
5052
const {coinType} = getState().signInKeyStore;
5153
loginCoinType = coinType;
5254
}else {
@@ -60,8 +62,6 @@ export const keyStoreSubmit = (loginAddress) => {
6062
const formData = getState().common.txInfo.value.data;
6163
const txName = getState().common.txName.value.name;
6264

63-
const encryptedSeed = getState().common.loginInfo.encryptedSeed;
64-
6565
const fee = getState().fee.fee.value.fee;
6666
const gas = getState().gas.gas.value;
6767

@@ -75,7 +75,7 @@ export const keyStoreSubmit = (loginAddress) => {
7575
}
7676
mnemonic = decryptedData.mnemonic;
7777
} else {
78-
mnemonic = await privateKeyReader(keyStoreData.value, password.value, loginAddress, accountNumber, accountIndex, loginCoinType);
78+
mnemonic = await privateKeyReader(keyStoreData.value, password.value, loginAddress, accountNumber, accountIndex, bip39PassPhrase, loginCoinType);
7979
}
8080

8181
let result = await transactions.getTransactionResponse(loginAddress, formData, fee, gas, mnemonic, txName, accountNumber, accountIndex, bip39PassPhrase, loginCoinType);

src/store/actions/transactions/ledger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const ledgerSubmit = (loginAddress, loginMode) => {
3030

3131
let mnemonic = "";
3232
if (loginMode !== "ledger") {
33-
mnemonic = await privateKeyReader(keyStoreData.value, password.value, loginAddress, coinType);
33+
mnemonic = await privateKeyReader(keyStoreData.value, password.value, loginAddress, accountNumber, accountIndex, bip39PassPhrase, coinType);
3434
}
3535
let response = transactions.getTransactionResponse(loginAddress, formData, fee, gas, mnemonic, txName, accountNumber, accountIndex, bip39PassPhrase, coinType);
3636
response.then(result => {

src/utils/helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export const tokenValueConversion = (data) => {
262262
return data / DefaultChainInfo.uTokenValue;
263263
};
264264

265-
export const privateKeyReader = (file, password, loginAddress, accountNumber = "0", addressIndex = "0", coinType = configCoinType) => {
265+
export const privateKeyReader = (file, password, loginAddress, accountNumber = "0", addressIndex = "0", bip39PassPhrase='', coinType = configCoinType) => {
266266
return new Promise(function (resolve, reject) {
267267
const fileReader = new FileReader();
268268
fileReader.readAsText(file, "UTF-8");
@@ -274,7 +274,7 @@ export const privateKeyReader = (file, password, loginAddress, accountNumber = "
274274
reject(new Error(decryptedData.error));
275275
} else {
276276
let mnemonic = mnemonicTrim(decryptedData.mnemonic);
277-
const accountData = await transactions.MnemonicWalletWithPassphrase(mnemonic, makeHdPath(accountNumber, addressIndex, coinType));
277+
const accountData = await transactions.MnemonicWalletWithPassphrase(mnemonic, makeHdPath(accountNumber, addressIndex, coinType), bip39PassPhrase);
278278
const address = accountData[1];
279279
if (address === loginAddress) {
280280
resolve(mnemonic);

src/utils/transactions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ async function Transaction(wallet, signerAddress, msgs, fee, memo = "") {
2828
}
2929

3030
async function TransactionWithKeplr(msgs, fee, memo = "", chainID = configChainID) {
31-
console.log(msgs, "msgs");
3231
const [wallet, address] = await KeplrWallet(chainID);
3332
return Transaction(wallet, address, msgs, fee, memo);
3433
}

0 commit comments

Comments
 (0)