@@ -101,7 +101,7 @@ async function claimPointFromInvite({
102 contracts,
102 contracts,
103 onUpdate,
103 onUpdate,
104− transferEth,
104+ transferEth = false,
106 const askForFunding = (address, minBalance, balance) =>
106 const askForFunding = (address, minBalance, balance) =>
107 onUpdate({
107 onUpdate({
@@ -122,11 +122,12 @@ async function claimPointFromInvite({
123 // transfer to invite wallet, so it can configure
123 // transfer to invite wallet, so it can configure
124 //NOTE doing this in the invite wallet instead of the final wallet makes
124 //NOTE doing this in the invite wallet instead of the final wallet makes
125− // failure cases "solvable" by just telling the user to fully retry
125+ // failure cases "solvable" by just telling the user to fully retry.
126+ // in other words, the invite flow is effectively idempotent.
127 //TODO no harm done if we already owned it, but should still get a bool arg
128 //TODO no harm done if we already owned it, but should still get a bool arg
128 // for skipping this, if it isn't too big a burden for callers
129 // for skipping this, if it isn't too big a burden for callers
129− let transferTmpTx = azimuth.ecliptic.transferPoint(
130+ const transferTmpTx = azimuth.ecliptic.transferPoint(
130 contracts,
131 contracts,
132 inviteAddress,
133 inviteAddress,
@@ -153,7 +154,7 @@ async function claimPointFromInvite({
154 const networkKeys = kg.deriveNetworkKeys(networkSeed);
155 const networkKeys = kg.deriveNetworkKeys(networkSeed);
156− let keysTx = azimuth.ecliptic.configureKeys(
157+ const keysTx = azimuth.ecliptic.configureKeys(
157 contracts,
158 contracts,
159 addHexPrefix(networkKeys.crypt.public),
160 addHexPrefix(networkKeys.crypt.public),
@@ -165,7 +166,7 @@ async function claimPointFromInvite({
166 // configure management proxy
167 // configure management proxy
168− let managementTx = azimuth.ecliptic.setManagementProxy(
169+ const managementTx = azimuth.ecliptic.setManagementProxy(
169 contracts,
170 contracts,
171 wallet.management.keys.address
172 wallet.management.keys.address
@@ -178,7 +179,7 @@ async function claimPointFromInvite({
179 azimuth.azimuth.getPointSize(point) !== azimuth.azimuth.PointSize.Planet
180 azimuth.azimuth.getPointSize(point) !== azimuth.azimuth.PointSize.Planet
181− let spawnTx = azimuth.ecliptic.setSpawnProxy(
182+ const spawnTx = azimuth.ecliptic.setSpawnProxy(
182 contracts,
183 contracts,
184 wallet.spawn.keys.address
185 wallet.spawn.keys.address
@@ -189,7 +190,7 @@ async function claimPointFromInvite({
190 azimuth.azimuth.getPointSize(point) === azimuth.azimuth.PointSize.Galaxy
191 azimuth.azimuth.getPointSize(point) === azimuth.azimuth.PointSize.Galaxy
192− let votingTx = azimuth.ecliptic.setVotingProxy(
193+ const votingTx = azimuth.ecliptic.setVotingProxy(
193 contracts,
194 contracts,
195 wallet.voting.keys.address
196 wallet.voting.keys.address
@@ -201,7 +202,7 @@ async function claimPointFromInvite({
202 // transfer configured point to user's new wallet
203 // transfer configured point to user's new wallet
204− let transferFinalTx = azimuth.ecliptic.transferPoint(
205+ const transferFinalTx = azimuth.ecliptic.transferPoint(
205 contracts,
206 contracts,
207 wallet.ownership.keys.address,
208 wallet.ownership.keys.address,
@@ -250,7 +251,6 @@ async function claimPointFromInvite({
250 askForFunding,
251 askForFunding,
251 gotFunding
252 gotFunding
253− console.log('used tank', usedTank);
256 // sending and awaiting transactions
256 // sending and awaiting transactions
@@ -258,9 +258,7 @@ async function claimPointFromInvite({
259 progress(TRANSACTION_STATES.CLAIMING);
259 progress(TRANSACTION_STATES.CLAIMING);
261− console.log('sending txpairs', txPairs.length);
262 await sendAndAwaitConfirm(web3, txPairs.map(p => Just(p.signed)), usedTank);
261 await sendAndAwaitConfirm(web3, txPairs.map(p => Just(p.signed)), usedTank);
263− console.log('all done');
266 // move leftover eth
264 // move leftover eth
@@ -275,7 +273,6 @@ async function claimPointFromInvite({
275 const sendEthCost = gasPrice * gasLimit;
273 const sendEthCost = gasPrice * gasLimit;
276 if (transferEth && balance > sendEthCost) {
274 if (transferEth && balance > sendEthCost) {
277 const value = balance - sendEthCost;
275 const value = balance - sendEthCost;
278− console.log('sending', value);
279 const tx = {
276 const tx = {
280 to: wallet.ownership.keys.address,
277 to: wallet.ownership.keys.address,
281 value: value,
278 value: value,
@@ -289,7 +286,6 @@ async function claimPointFromInvite({
289 web3.eth.sendSignedTransaction(rawTx).catch(err => {
286 web3.eth.sendSignedTransaction(rawTx).catch(err => {
290 console.log('error sending value tx, who cares', err);
287 console.log('error sending value tx, who cares', err);
292− console.log('sent old balance');
295 progress(TRANSACTION_STATES.DONE);
291 progress(TRANSACTION_STATES.DONE);