@@ -63,6 +63,7 @@ const signTransaction = async config => {
64 } = config;
64 } = config;
66+ //TODO require these in txn object
66 nonce = toHex(nonce);
67 nonce = toHex(nonce);
67 chainId = toHex(chainId);
68 chainId = toHex(chainId);
68 gasPrice = toHex(toWei(gasPrice, 'gwei'));
69 gasPrice = toHex(toWei(gasPrice, 'gwei'));
@@ -117,6 +118,9 @@ const signTransaction = async config => {
118 const stx = new Tx(utx);
119 const stx = new Tx(utx);
121+ //TODO should try-catch and display error message to user,
122+ // ie ledger's "pls enable contract data"
123+ // needs to maybe happen at call-site though
120 if (walletType === WALLET_TYPES.LEDGER) {
124 if (walletType === WALLET_TYPES.LEDGER) {
121 await ledgerSignTransaction(stx, walletHdPath);
125 await ledgerSignTransaction(stx, walletHdPath);
122 } else if (walletType === WALLET_TYPES.TREZOR) {
126 } else if (walletType === WALLET_TYPES.TREZOR) {
@@ -166,7 +170,7 @@ const sendSignedTransaction = (web3, stx, doubtNonceError) => {
166const waitForTransactionConfirm = (web3, txHash) => {
170const waitForTransactionConfirm = (web3, txHash) => {
167 return retry(async (bail, n) => {
171 return retry(async (bail, n) => {
168 const receipt = await web3.eth.getTransactionReceipt(txHash);
172 const receipt = await web3.eth.getTransactionReceipt(txHash);
169− let confirmed = receipt !== null;
173+ const confirmed = receipt !== null;
170 if (confirmed) return receipt.status === true;
174 if (confirmed) return receipt.status === true;
171 else throw new Error('retrying');
175 else throw new Error('retrying');
172 }, RETRY_OPTIONS);
176 }, RETRY_OPTIONS);