@@ -57,7 +57,7 @@ const renderNetworkKey = key => {
57function useSetKeys() {
57function useSetKeys() {
58 const { urbitWallet, wallet, authMnemonic } = useWallet();
58 const { urbitWallet, wallet, authMnemonic } = useWallet();
59 const { pointCursor } = usePointCursor();
59 const { pointCursor } = usePointCursor();
60− const { syncOwnedPoint, getDetails } = usePointCache();
60+ const { syncDetails, syncRekeyDate, getDetails } = usePointCache();
61 const { contracts } = useNetwork();
61 const { contracts } = useNetwork();
63 const _point = need.point(pointCursor);
63 const _point = need.point(pointCursor);
@@ -75,26 +75,6 @@ function useSetKeys() {
75 bind: keyfileBind,
75 bind: keyfileBind,
76 } = useKeyfileGenerator(ndNetworkSeed);
76 } = useKeyfileGenerator(ndNetworkSeed);
80− construct: _construct,
83− confirmed: _confirmed,
86− } = useEthereumTransaction(GAS_LIMITS.CONFIGURE_KEYS);
88− // only treat the transaction as confirmed once we also have keys to download
89− const confirmed = _confirmed && keyfileAvailable;
91− // sync point details after success
94− syncOwnedPoint(_point);
96− }, [_point, confirmed, syncOwnedPoint]);
98 const buildNetworkSeed = useCallback(
78 const buildNetworkSeed = useCallback(
99 async manualSeed => {
79 async manualSeed => {
100 if (manualSeed !== undefined) {
80 if (manualSeed !== undefined) {
@@ -125,35 +105,38 @@ function useSetKeys() {
125 [_details, authMnemonic, networkRevision, urbitWallet, wallet]
105 [_details, authMnemonic, networkRevision, urbitWallet, wallet]
128− const construct = useCallback(
108+ const { completed: _completed, ...rest } = useEthereumTransaction(
129− async (manualSeed, isDiscontinuity) => {
110+ async (manualSeed, isDiscontinuity) => {
130− const seed = await buildNetworkSeed(manualSeed);
111+ const seed = await buildNetworkSeed(manualSeed);
131− const pair = deriveNetworkKeys(seed);
112+ const pair = deriveNetworkKeys(seed);
133− const txn = azimuth.ecliptic.configureKeys(
114+ return azimuth.ecliptic.configureKeys(
134− _contracts,
115+ _contracts,
136− addHexPrefix(pair.crypt.public),
117+ addHexPrefix(pair.crypt.public),
137− addHexPrefix(pair.auth.public),
118+ addHexPrefix(pair.auth.public),
138− CRYPTO_SUITE_VERSION,
119+ CRYPTO_SUITE_VERSION,
139− isDiscontinuity
120+ isDiscontinuity
142− _construct(txn);
123+ [_contracts, _point, buildNetworkSeed]
144− [_construct, _contracts, _point, buildNetworkSeed]
125+ useCallback(
126+ () => Promise.all([syncDetails(_point), syncRekeyDate(_point)]),
127+ [_point, syncDetails, syncRekeyDate]
129+ GAS_LIMITS.CONFIGURE_KEYS
132+ // only treat the transaction as completed once we also have keys to download
133+ const completed = _completed && keyfileAvailable;
148− isDefaultState,
136+ completed,
153 ndNetworkSeed,
137 ndNetworkSeed,
156 keyfileBind,
138 keyfileBind,
@@ -175,7 +158,7 @@ export default function AdminNetworkingKeys() {
175 construct,
158 construct,
176 unconstruct,
159 unconstruct,
177 broadcasting,
160 broadcasting,
178− confirmed,
161+ completed,
179 inputsLocked,
162 inputsLocked,
181 keyfileBind,
164 keyfileBind,
@@ -237,7 +220,7 @@ export default function AdminNetworkingKeys() {
237 const goRelocate = useCallback(() => push(names.RELOCATE), [push, names]);
220 const goRelocate = useCallback(() => push(names.RELOCATE), [push, names]);
239 const renderTitle = () => {
222 const renderTitle = () => {
240− if (confirmed) {
223+ if (completed) {
241 return 'Networking keys are now set. Download your Keyfile to authenticate Arvo.';
224 return 'Networking keys are now set. Download your Keyfile to authenticate Arvo.';
@@ -344,7 +327,7 @@ export default function AdminNetworkingKeys() {
344 : 'Set your networking keys to authenticate with Arvo.'}
327 : 'Set your networking keys to authenticate with Arvo.'}
345 </Grid.Item>
328 </Grid.Item>
347− {confirmed && (
330+ {completed && (
349 <Grid.Item full as={NoticeBox} className="mb3">
332 <Grid.Item full as={NoticeBox} className="mb3">
350 You need this keyfile to authenticate with Arvo.
333 You need this keyfile to authenticate with Arvo.
@@ -353,7 +336,7 @@ export default function AdminNetworkingKeys() {
356− {!confirmed && (
339+ {!completed && (
358 <Grid.Item full as={ToggleInput} {...showNetworkSeedInput} />
341 <Grid.Item full as={ToggleInput} {...showNetworkSeedInput} />
359 {showNetworkSeed && (
342 {showNetworkSeed && (
@@ -361,7 +344,7 @@ export default function AdminNetworkingKeys() {
361 <Grid.Item full as={NoticeBox} className="mb2">
344 <Grid.Item full as={NoticeBox} className="mb2">
362 When using a custom network seed, you'll need to download your
345 When using a custom network seed, you'll need to download your
363 Arvo keyfile immediately after this transaction is
346 Arvo keyfile immediately after this transaction is
364− confirmed—Multipass does not store your seed.
347+ completed—Multipass does not store your seed.
365 </Grid.Item>
348 </Grid.Item>
366 <Grid.Item full as={Input} {...networkSeedInput} />
349 <Grid.Item full as={Input} {...networkSeedInput} />
@@ -380,7 +363,7 @@ export default function AdminNetworkingKeys() {
381 {isDefaultState && renderDetails()}
364 {isDefaultState && renderDetails()}
383− {confirmed && (
366+ {completed && (
385 <Grid.Item full as={BootArvoButton} disabled />
368 <Grid.Item full as={BootArvoButton} disabled />
386 <Grid.Divider />
369 <Grid.Divider />