on master help sign in
disable tank for metamask users
884e294Liam Fitzgerald
src/lib/reticket.js+1
@@ -189,6 +189,7 @@ export async function reticketPointBetweenWallets({
189 web3,
189 web3,
190 point,
190 point,
191 fromWallet.address,
191 fromWallet.address,
192+ fromWalletType,
192 totalCost,
193 totalCost,
193 txPairs.map(p => p.raw),
194 txPairs.map(p => p.raw),
194 askForFunding,
195 askForFunding,
src/lib/tank.js+7
@@ -3,6 +3,7 @@
3import retry from 'async-retry';
3import retry from 'async-retry';
4import { toBN } from 'web3-utils';
4import { toBN } from 'web3-utils';
5import { RETRY_OPTIONS, waitForTransactionConfirm } from './txn';
5import { RETRY_OPTIONS, waitForTransactionConfirm } from './txn';
6+import { WALLET_TYPES } from 'lib/wallet';
6
7
7//NOTE if accessing this in a localhost configuration fails with "CORS request
8//NOTE if accessing this in a localhost configuration fails with "CORS request
8// did not succeed", you might need to visit localhost:3001 or whatever
9// did not succeed", you might need to visit localhost:3001 or whatever
@@ -49,6 +50,7 @@ const ensureFundsFor = async (
49 web3,
50 web3,
50 point,
51 point,
51 address,
52 address,
53+ walletType,
52 cost,
54 cost,
53 signedTxs,
55 signedTxs,
54 askForFunding,
56 askForFunding,
@@ -66,6 +68,11 @@ const ensureFundsFor = async (
66 return false;
68 return false;
67 }
69 }
68
70
71+ if (walletType === WALLET_TYPES.METAMASK) {
72+ console.log('tank: disabling for metamask login');
73+
74+ return false;
75+ }
69 try {
76 try {
70 // TODO: if we can't always (easily) provide a point, and the
77 // TODO: if we can't always (easily) provide a point, and the
71 // fundTransactions call is gonna fail anyway, should we maybe
78 // fundTransactions call is gonna fail anyway, should we maybe
src/lib/useEthereumTransaction.js+1
@@ -157,6 +157,7 @@ export default function useEthereumTransaction(
157 _web3,
157 _web3,
158 pointCursor.value,
158 pointCursor.value,
159 _wallet.address,
159 _wallet.address,
160+ walletType,
160 cost,
161 cost,
161 rawTxs,
162 rawTxs,
162 (address, minBalance, balance) =>
163 (address, minBalance, balance) =>
src/views/Invite/InviteEmail.js+2
@@ -316,6 +316,7 @@ export default function InviteEmail() {
316 _web3,
316 _web3,
317 point,
317 point,
318 _wallet.address,
318 _wallet.address,
319+ walletType,
319 toWei(totalCost.toString(), 'gwei'),
320 toWei(totalCost.toString(), 'gwei'),
320 names.map(name => invites[name].rawTx),
321 names.map(name => invites[name].rawTx),
321 (address, minBalance, balance) =>
322 (address, minBalance, balance) =>
@@ -384,6 +385,7 @@ export default function InviteEmail() {
384 }, [
385 }, [
385 web3,
386 web3,
386 wallet,
387 wallet,
388+ walletType,
387 gasPrice,
389 gasPrice,
388 point,
390 point,
389 clearReceipts,
391 clearReceipts,