@@ -226,8 +226,12 @@ async function startTransactions(args) {
226 const transferCost = transferTx.gas * transferTx.gasPrice;
226 const transferCost = transferTx.gas * transferTx.gasPrice;
227 await ensureFundsFor(web3, point, inviteAddress, transferCost, [rawTransferStx], updateProgress, true);
227 await ensureFundsFor(web3, point, inviteAddress, transferCost, [rawTransferStx], updateProgress, true);
231+ value: TRANSACTION_STATES.CLAIMING
229 // send transaction
234 // send transaction
230− updateProgress(TRANSACTION_STATES.CLAIMING);
231 await sendAndAwaitConfirm(web3, [rawTransferStx]);
235 await sendAndAwaitConfirm(web3, [rawTransferStx]);
@@ -286,11 +290,19 @@ async function startTransactions(args) {
287 await ensureFundsFor(web3, point, newAddress, totalCost, rawStxs, updateProgress, false);
291 await ensureFundsFor(web3, point, newAddress, totalCost, rawStxs, updateProgress, false);
289− updateProgress(TRANSACTION_STATES.CONFIGURING);
295+ value: TRANSACTION_STATES.CONFIGURING
290 await sendAndAwaitConfirm(web3, rawStxs);
298 await sendAndAwaitConfirm(web3, rawStxs);
302+ value: TRANSACTION_STATES.CLEANING
292 // if non-trivial eth left in invite wallet, transfer to new ownership
305 // if non-trivial eth left in invite wallet, transfer to new ownership
293− updateProgress(TRANSACTION_STATES.CLEANING);
294 let balance = await web3.eth.getBalance(inviteAddress);
306 let balance = await web3.eth.getBalance(inviteAddress);
295 const gasPrice = 20000000000;
307 const gasPrice = 20000000000;
296 const gasLimit = 21000;
308 const gasLimit = 21000;
@@ -314,16 +326,23 @@ async function startTransactions(args) {
314 console.log('sent old balance');
326 console.log('sent old balance');
331+ value: TRANSACTION_STATES.DONE
317 // proceed without waiting for confirm
334 // proceed without waiting for confirm
318− updateProgress(TRANSACTION_STATES.DONE);
319 setUrbitWallet(Just(realWallet));
335 setUrbitWallet(Just(realWallet));
320− //TODO forward to "all done!" screen
323async function ensureFundsFor(web3, point, address, cost, signedTxs, updateProgress, firstTx) {
338async function ensureFundsFor(web3, point, address, cost, signedTxs, updateProgress, firstTx) {
324 let fundingState = firstTx? TRANSACTION_STATES.FUNDING_INVITE : TRANSACTION_STATES.FUNDING_RECIPIENT
339 let fundingState = firstTx? TRANSACTION_STATES.FUNDING_INVITE : TRANSACTION_STATES.FUNDING_RECIPIENT
326− updateProgress(fundingState);
341+ updateProgress({
327 let balance = await web3.eth.getBalance(address);
346 let balance = await web3.eth.getBalance(address);
329 if (cost > balance) {
348 if (cost > balance) {
@@ -422,7 +441,10 @@ function awaitForResult(desired, retryTime, func) {
424function askForFunding(address, amount, current, updateProgress) {
443function askForFunding(address, amount, current, updateProgress) {
425− updateProgress(`Please make sure ${address} has at least ${amount} wei, we'll continue once that's true. Current balance: ${current}. Waiting`);
446+ value: `Please make sure ${address} has at least ${amount} wei, we'll continue once that's true. Current balance: ${current}. Waiting`