@@ -34,9 +34,10 @@ const PROGRESS_STATES = {
3434 GENERATING: 'Generating transactions',
3535 SIGNING: 'Signing transactions',
3636 FUNDING: 'Funding transactions',
37− SENDING: 'Sending transactions',
38− WAITING: 'Waiting for transaction confirmations',
39− CLEANING: 'Cleaning up'
37+ CLAIMING: 'Claiming invite',
38+ CONFIGURING: 'Configuring planet',
39+ CLEANING: 'Cleaning up',
40+ DONE: 'Done'
4041}
4142
4243class InviteVerify extends React.Component {
@@ -46,7 +47,8 @@ class InviteVerify extends React.Component {
4647
4748 this.state = {
4849 point: this.props.routeData.point,
49− ticket: this.props.routeData.ticket
50+ ticket: this.props.routeData.ticket,
51+ progress: 'Starting'
5052 }
5153
5254 this.startTransactions = this.startTransactions.bind(this);
@@ -54,6 +56,7 @@ class InviteVerify extends React.Component {
5456
5557 componentDidMount() {
5658 //NOTE delayed so that we hang *after* rendering the page
59+ this.updateProgress('Generating transactions');
5760 setTimeout(this.startTransactions, 100);
5861 }
5962
@@ -61,6 +64,14 @@ class InviteVerify extends React.Component {
6164 //
6265 }
6366
67+ updateProgress(msg) {
68+ this.setState({progress: msg+'...'});
69+ }
70+
71+ askForFunding(address, amount, current) {
72+ this.updateProgress(`Please make sure ${address} has at least ${amount} wei, we'll continue once that's true. Current balance: ${current}. Waiting`);
73+ }
74+
6475 async startTransactions() {
6576 const { point } = this.state;
6677
@@ -104,6 +115,7 @@ class InviteVerify extends React.Component {
104115 await this.ensureFundsFor(web3, point, inviteAddress, transferCost, [rawTransferStx]);
105116
106117 // send transaction
118+ this.updateProgress(PROGRESS_STATES.CLAIMING);
107119 await this.sendAndAwaitConfirm(web3, [rawTransferStx]);
108120
109121 //
@@ -162,11 +174,11 @@ class InviteVerify extends React.Component {
162174
163175 await this.ensureFundsFor(web3, point, newAddress, totalCost, rawStxs);
164176
177+ this.updateProgress(PROGRESS_STATES.CONFIGURING);
165178 await this.sendAndAwaitConfirm(web3, rawStxs);
166− console.log('sent transactions');
167179
168180 // if non-trivial eth left in invite wallet, transfer to new ownership
169− //TODO
181+ this.updateProgress(PROGRESS_STATES.CLEANING);
170182 let balance = await web3.eth.getBalance(inviteAddress);
171183 const gasPrice = 20000000000;
172184 const gasLimit = 21000;
@@ -191,11 +203,13 @@ class InviteVerify extends React.Component {
191203 }
192204
193205 // proceed without waiting for confirm
206+ this.updateProgress(PROGRESS_STATES.DONE);
194207 this.props.setUrbitWallet(Just(newUrbitWallet));
195208 //TODO forward to "all done!" screen
196209 }
197210
198211 async ensureFundsFor(web3, point, address, cost, signedTxs) {
212+ this.updateProgress(PROGRESS_STATES.FUNDING);
199213 let balance = await web3.eth.getBalance(address);
200214
201215 if (cost > balance) {
@@ -263,7 +277,6 @@ class InviteVerify extends React.Component {
263277 </>
264278 );
265279
266− console.log('tickets', this.state.ticket, this.state.realTicket, (this.state.realTicket === this.state.ticket));
267280 return (
268281 <Row>
269282 <Col>
@@ -272,6 +285,8 @@ class InviteVerify extends React.Component {
272285
273286 <p>{ 'Please wait while your wallet and point are prepared for use. This may take up to five minutes.' }</p>
274287
288+ <p>{ this.state.progress }</p>
289+
275290 </Col>
276291 </Row>
277292 )