Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable EIP-155 for PIRL just as was done for CLO #195

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/scripts/directives/walletDecryptDrtv.html
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,18 @@ <h4 id="modalTitle" class="modal-title" translate="ADD_Radio_5_Path" style="marg
</label>
</div>

<div class="col-sm-4">
<label class="radio small">
<input aria-describedby="Path: Ledger (PIRL) {{HDWallet.hwPirlPath}}"
ng-change="onHDDPathChange()"
ng-model="HDWallet.dPath"
type="radio"
value="{{HDWallet.hwPirlPath}}"/>
<span ng-bind="HDWallet.hwPirlPath"></span>
<p class="small">Network: PIRL</p>
</label>
</div>

<div class="col-sm-4">
<label class="radio small">
<input aria-describedby="Path: TREZOR (CLO) {{HDWallet.hwCallistoPath}}"
Expand Down
7 changes: 7 additions & 0 deletions app/scripts/globalFuncs.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ globalFuncs.HDWallet = {
hwMusicoinPath: "m/44'/184'/0'/0", // first address: m/44'/184'/0'/0/0
hwRskPath: "m/44'/137'/0'/0", // first address : m/44'/137'/0'/0/0
hwESNetworkPath: "m/44'/31102'/0'/0", // first address : m/44'/31102'/0'/0/0
hwPirlPath: "m/44'/164'/0'/0", // first address: m/44'/164'/0'/0/0
};

globalFuncs.getWalletPath = function (walletType = 'trezor', nodeType = nodes.nodeTypes.CLO) {
Expand All @@ -386,6 +387,8 @@ globalFuncs.getWalletPath = function (walletType = 'trezor', nodeType = nodes.no
return globalFuncs.HDWallet.hwExpansePath;
case nodes.nodeTypes.UBQ:
return globalFuncs.HDWallet.hwUbqPath;
case nodes.nodeTypes.PIRL:
return globalFuncs.HDWallet.hwPirlPath;
default:
return globalFuncs.HDWallet.ledgerPath;
}
Expand Down Expand Up @@ -421,6 +424,8 @@ globalFuncs.getWalletPath = function (walletType = 'trezor', nodeType = nodes.no
return globalFuncs.HDWallet.hwMusicoinPath;
case nodes.nodeTypes.ESN:
return globalFuncs.HDWallet.hwESNetworkPath;
case nodes.nodeTypes.PIRL:
return globalFuncs.HDWallet.hwPirlPath;
default:
return globalFuncs.HDWallet.defaultDPath;
}
Expand Down Expand Up @@ -452,6 +457,8 @@ globalFuncs.getWalletPath = function (walletType = 'trezor', nodeType = nodes.no
return globalFuncs.HDWallet.hwMusicoinPath;
case nodes.nodeTypes.ESN:
return globalFuncs.HDWallet.hwESNetworkPath;
case nodes.nodeTypes.PIRL:
return globalFuncs.HDWallet.hwPirlPath;
default:
return globalFuncs.HDWallet.defaultDPath;
}
Expand Down
9 changes: 6 additions & 3 deletions app/scripts/uiFuncs.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ uiFuncs.isTxDataValid = function (txData) {


*/
const removeChainIdIfCLO = (chainId) => parseInt(chainId) === 820 ? null : chainId;
const removeChainIdIfUnwanted = (chainId) => {
var cId = parseInt(chainId);
return (cId === 820 || cId === 3125659152) ? null : chainId;
}


uiFuncs.signTxTrezor = function (rawTx, txData, callback) {
Expand All @@ -65,7 +68,7 @@ uiFuncs.signTxTrezor = function (rawTx, txData, callback) {
}


const chainId = removeChainIdIfCLO(rawTx.chainId);
const chainId = removeChainIdIfUnwanted(rawTx.chainId);


TrezorConnect.signEthereumTx(
Expand Down Expand Up @@ -232,7 +235,7 @@ uiFuncs.genTxWithInfo = function (data, callback) {
error: error
});

} else if (rawTx.chainId === 820) {
} else if (rawTx.chainId === 820 || rawTx.chainId === 3125659152) {

EIP155Supported = false;

Expand Down