on master help sign in
Only do may-throw logic if it's needed
a2ce09cFang
src/bridge/lib/keys.js+7−7
@@ -70,13 +70,6 @@ const attemptSeedDerivation = async (next, args) => {
70 //
70 //
71 // following code is intentionally verbose for sake of clarity
71 // following code is intentionally verbose for sake of clarity
72
72
73− const walProxy = wallet.matchWith({
74− Just: wal => addressFromSecp256k1Public(wal.value.publicKey),
75− Nothing: _ => {
76− throw BRIDGE_ERROR.MISSING_WALLET
77− }
78− })
79−
80 const point = pointCursor.matchWith({
73 const point = pointCursor.matchWith({
81 Just: pt => pt.value,
74 Just: pt => pt.value,
82 Nothing: _ => {
75 Nothing: _ => {
@@ -111,6 +104,13 @@ const attemptSeedDerivation = async (next, args) => {
111
104
112 } else if (walletType === WALLET_NAMES.MNEMONIC) {
105 } else if (walletType === WALLET_NAMES.MNEMONIC) {
113
106
107+ const walProxy = wallet.matchWith({
108+ Just: wal => addressFromSecp256k1Public(wal.value.publicKey),
109+ Nothing: _ => {
110+ throw BRIDGE_ERROR.MISSING_WALLET
111+ }
112+ })
113+
114 const mnemonic = authMnemonic.matchWith({
114 const mnemonic = authMnemonic.matchWith({
115 Just: mnem => mnem.value,
115 Just: mnem => mnem.value,
116 Nothing: _ => {
116 Nothing: _ => {