@@ -59,9 +59,12 @@ function useSetKeys() {
59 const { pointCursor } = usePointCursor();
59 const { pointCursor } = usePointCursor();
60 const { syncOwnedPoint, getDetails } = usePointCache();
60 const { syncOwnedPoint, getDetails } = usePointCache();
61 const { contracts } = useNetwork();
61 const { contracts } = useNetwork();
62 const _point = need.point(pointCursor);
63 const _point = need.point(pointCursor);
63 const _contracts = need.contracts(contracts);
64 const _contracts = need.contracts(contracts);
65+ const _details = need.details(getDetails(_point));
67+ const networkRevision = parseInt(_details.keyRevisionNumber, 10);
65 const randomSeed = useRef();
68 const randomSeed = useRef();
67 // NOTE: nd = 'nondeterministic' (can also be a 'manual' seed)
70 // NOTE: nd = 'nondeterministic' (can also be a 'manual' seed)
@@ -92,21 +95,21 @@ function useSetKeys() {
93 }, [_point, confirmed, syncOwnedPoint]);
96 }, [_point, confirmed, syncOwnedPoint]);
95− const getSeed = useCallback(
98+ const buildNetworkSeed = useCallback(
96 async manualSeed => {
99 async manualSeed => {
97− const details = need.details(getDetails(_point));
98− const networkRevision = parseInt(details.keyRevisionNumber, 10);
100 if (manualSeed !== undefined) {
100 if (manualSeed !== undefined) {
101 setNdNetworkSeed(manualSeed);
101 setNdNetworkSeed(manualSeed);
102 return manualSeed;
102 return manualSeed;
104+ const newNetworkRevision = networkRevision + 1;
105+ console.log(`deriving seed with revision ${newNetworkRevision}`);
104 const networkSeed = await attemptNetworkSeedDerivation({
107 const networkSeed = await attemptNetworkSeedDerivation({
105 urbitWallet,
108 urbitWallet,
107 authMnemonic,
110 authMnemonic,
108− details,
111+ details: _details,
109− revision: networkRevision,
112+ revision: newNetworkRevision,
112 if (Just.hasInstance(networkSeed)) {
115 if (Just.hasInstance(networkSeed)) {
@@ -119,12 +122,12 @@ function useSetKeys() {
119 return randomSeed.current;
122 return randomSeed.current;
122− [_point, authMnemonic, getDetails, urbitWallet, wallet]
125+ [_details, authMnemonic, networkRevision, urbitWallet, wallet]
125 const construct = useCallback(
128 const construct = useCallback(
126 async (manualSeed, isDiscontinuity) => {
129 async (manualSeed, isDiscontinuity) => {
127− const seed = await getSeed(manualSeed);
130+ const seed = await buildNetworkSeed(manualSeed);
128 const pair = deriveNetworkKeys(seed);
131 const pair = deriveNetworkKeys(seed);
130 const txn = azimuth.ecliptic.configureKeys(
133 const txn = azimuth.ecliptic.configureKeys(
@@ -138,7 +141,7 @@ function useSetKeys() {
139 _construct(txn);
142 _construct(txn);
141− [_construct, _contracts, _point, getSeed]
144+ [_construct, _contracts, _point, buildNetworkSeed]