@@ -136,7 +136,7 @@ const signTransaction = async config => {
136 return stx;
136 return stx;
139−const sendSignedTransaction = (web3, stx, doubtNonceError, confirmationCb) => {
139+const sendSignedTransaction = (web3, stx, doubtNonceError) => {
140 const txn = stx.matchWith({
140 const txn = stx.matchWith({
141 Just: tx => tx.value,
141 Just: tx => tx.value,
142 Nothing: () => {
142 Nothing: () => {
@@ -152,14 +152,6 @@ const sendSignedTransaction = (web3, stx, doubtNonceError, confirmationCb) => {
152 .on('transactionHash', hash => {
152 .on('transactionHash', hash => {
153 resolve(hash);
153 resolve(hash);
155− //TODO do we also reach this if network is slow? web3 only tries a set
156− // amount of times... should we instead do waitForTransactionConfirm
157− // in on-transactionHash? we don't care (much) about additional
159− .on('confirmation', (confirmationNum, txn) => {
160− confirmationCb(txn.transactionHash, confirmationNum + 1);
161− resolve(txn.transactionHash);
163 .on('error', err => {
155 .on('error', err => {
164 // if there's a nonce error, but we used the gas tank, it's likely
156 // if there's a nonce error, but we used the gas tank, it's likely
165 // that it's because the tank already submitted our transaction.
157 // that it's because the tank already submitted our transaction.
@@ -176,16 +168,7 @@ const sendSignedTransaction = (web3, stx, doubtNonceError, confirmationCb) => {
176 'tx send error likely from gas tank submission, ignoring'
168 'tx send error likely from gas tank submission, ignoring'
178 const txHash = web3.utils.keccak256(rawTx);
170 const txHash = web3.utils.keccak256(rawTx);
179− //TODO can we do does-exists check first?
180− //TODO max wait time before assume fail?
181− waitForTransactionConfirm(web3, txHash).then(res => {
183− resolve(txHash);
171+ resolve(txHash);
184− confirmationCb(txHash, 1);
186− reject('Unexpected tx failure');
190 reject(err.message || 'Transaction sending failed!');
173 reject(err.message || 'Transaction sending failed!');