@@ -11,7 +11,7 @@ import { deriveNetworkKeys } from 'urbit-key-generation';
1111import { convertToInt } from './convertToInt';
1212import {
1313 attemptNetworkSeedDerivation,
14− compileMultikey,
14+ compileMultiKey,
1515 keysMatchChain,
1616} from './keys';
1717import { generateCode } from './networkCode';
@@ -80,7 +80,7 @@ export default function useMultikeyFileGenerator({
8080 ? Just(seed)
8181 : await attemptNetworkSeedDerivation({
8282 urbitWallet: seedWallet || urbitWallet,
83− wallet,
83+ wallet: wallet,
8484 authMnemonic,
8585 details: _details,
8686 authToken,
@@ -127,38 +127,40 @@ export default function useMultikeyFileGenerator({
127127 return;
128128 }
129129
130− // TODO: Do we still need this? The legacy implementation in useKeyfileGenerator
131− // performed this guard statement
130+ const currentPair = await pairFromRevision(currentRevision);
132131
133− // const currentPair = await pairFromRevision(currentRevision);
134−
135− // if (!currentPair || !keysMatchChain(currentPair, _details)) {
136− // setGenerating(false);
137− // setNotice('Derived networking keys do not match on-chain details.');
138− // console.log(`keys do not match details for revision ${currentRevision}`);
139− // return;
140− // }
141−
142− // const nextPair = await pairFromRevision(nextRevision);
132+ if (!currentPair || !keysMatchChain(currentPair, _details || {})) {
133+ setGenerating(false);
134+ setNotice('Derived networking keys do not match on-chain details.');
135+ console.log(`keys do not match details for revision ${currentRevision}`);
136+ return;
137+ }
143138
144− const [currentPair, nextPair] = await Promise.all([
145− pairFromRevision(currentRevision),
146− pairFromRevision(nextRevision),
147− ]);
139+ const nextPair = await pairFromRevision(nextRevision);
148140
149141 setNotice('');
150142 setCode(generateCode(currentPair));
151143 setKeyfile(
152− compileMultikey(
153− _point,
154− currentPair,
155− nextPair,
156− currentRevision,
157− nextRevision
158− )
144+ compileMultiKey(_point, [
145+ {
146+ revision: currentRevision,
147+ pair: currentPair,
148+ },
149+ {
150+ revision: nextRevision,
151+ pair: nextPair,
152+ },
153+ ])
159154 );
160155 setGenerating(false);
161− }, [_point, currentRevision, hasNetworkKeys, nextRevision, pairFromRevision]);
156+ }, [
157+ _details,
158+ _point,
159+ currentRevision,
160+ hasNetworkKeys,
161+ nextRevision,
162+ pairFromRevision,
163+ ]);
162164
163165 const filename = useMemo(() => {
164166 return `${stripSigPrefix(ob.patp(_point))}-${currentRevision}.key`;