on master help sign in
api: retrieve latest nonce from Roller api
baa23b6yosoyubik
src/lib/useRoller.ts+49−73
@@ -22,12 +22,7 @@ import {
22} from 'store/storage/roller';
22} from 'store/storage/roller';
23import { usePointCache } from 'store/pointCache';
23import { usePointCache } from 'store/pointCache';
24import { getOutgoingPoints } from 'views/Points';
24import { getOutgoingPoints } from 'views/Points';
25−import {
26− getSpawnNonce,
27− getOwnerNonce,
28− getManagementNonce,
29− getTransferNonce,
30−} from './utils/nonce';
25+import { getProxy } from './utils/proxy';
31import { isPlanet } from './utils/point';
26import { isPlanet } from './utils/point';
32
27
33import {
28import {
@@ -78,9 +73,6 @@ export default function useRoller() {
78 setPendingTransactions,
73 setPendingTransactions,
79 setInvites,
74 setInvites,
80 currentL2,
75 currentL2,
81− nonces,
82− increaseNonce,
83− setNonce,
84 } = useRollerStore();
76 } = useRollerStore();
85 const [config, setConfig] = useState<Config | null>(null);
77 const [config, setConfig] = useState<Config | null>(null);
86
78
@@ -158,12 +150,9 @@ export default function useRoller() {
158 new Set<number>()
150 new Set<number>()
159 );
151 );
160
152
161− console.log(pendingTxs, pendingSpawns);
162−
163 planets = planets.filter((point: number) => !pendingSpawns.has(point));
153 planets = planets.filter((point: number) => !pendingSpawns.has(point));
164
154
165− const starInfo = nonces[_point];
155+ const starInfo = await api.getPoint(_point);
166− console.log(starInfo);
167 const tickets: {
156 const tickets: {
168 ticket: string;
157 ticket: string;
169 planet: number;
158 planet: number;
@@ -171,16 +160,19 @@ export default function useRoller() {
171 }[] = [];
160 }[] = [];
172 const requests: Promise<string>[] = [];
161 const requests: Promise<string>[] = [];
173
162
174− const operator =
175− getSpawnNonce(starInfo, _wallet.address) ||
176− getOwnerNonce(starInfo, _wallet.address);
163+ const proxy = getProxy(starInfo.ownership!, _wallet.address);
177
164
178− if (operator === undefined)
165+ if (proxy === undefined)
179 throw new Error("Error: Address doesn't match proxy");
166 throw new Error("Error: Address doesn't match proxy");
180− console.log('operator', operator);
167+
168+ const nonce = await api.getNonce({
169+ ship: _point,
170+ proxy: proxy,
171+ });
172+
181 for (let i = 0; i < numInvites && planets[i]; i++) {
173 for (let i = 0; i < numInvites && planets[i]; i++) {
182 const planet = planets[i];
174 const planet = planets[i];
183− const nonceInc = i + operator.nonce!;
175+ const nonceInc = i + nonce;
184
176
185 const { ticket, inviteWallet } = await generateInviteWallet(
177 const { ticket, inviteWallet } = await generateInviteWallet(
186 planet,
178 planet,
@@ -191,11 +183,10 @@ export default function useRoller() {
191 api,
183 api,
192 _wallet,
184 _wallet,
193 _point,
185 _point,
194− operator.proxy!,
186+ proxy,
195 nonceInc,
187 nonceInc,
196 planet
188 planet
197 );
189 );
198− increaseNonce(_point, operator.proxy!);
199
190
200 const networkSeed = await deriveNetworkSeedFromUrbitWallet(
191 const networkSeed = await deriveNetworkSeedFromUrbitWallet(
201 inviteWallet,
192 inviteWallet,
@@ -205,7 +196,7 @@ export default function useRoller() {
205 api,
196 api,
206 _wallet,
197 _wallet,
207 planet,
198 planet,
208− operator.proxy!,
199+ proxy,
209 0,
200 0,
210 networkSeed
201 networkSeed
211 );
202 );
@@ -214,7 +205,7 @@ export default function useRoller() {
214 api,
205 api,
215 _wallet,
206 _wallet,
216 planet,
207 planet,
217− operator.proxy!,
208+ proxy,
218 'manage',
209 'manage',
219 1,
210 1,
220 inviteWallet.management.keys.address
211 inviteWallet.management.keys.address
@@ -224,7 +215,7 @@ export default function useRoller() {
224 api,
215 api,
225 _wallet,
216 _wallet,
226 planet,
217 planet,
227− operator.proxy!,
218+ proxy,
228 2,
219 2,
229 inviteWallet.ownership.keys.address
220 inviteWallet.ownership.keys.address
230 );
221 );
@@ -250,7 +241,6 @@ export default function useRoller() {
250 status: 'pending',
241 status: 'pending',
251 }));
242 }));
252
243
253− console.log('latest update', nonces[_point]);
254 setPendingInvites(_point, pendingInvites);
244 setPendingInvites(_point, pendingInvites);
255 },
245 },
256 [
246 [
@@ -262,8 +252,6 @@ export default function useRoller() {
262 web3,
252 web3,
263 getDetails,
253 getDetails,
264 authMnemonic,
254 authMnemonic,
265− nonces,
266− increaseNonce,
267 ]
255 ]
268 );
256 );
269
257
@@ -431,12 +419,17 @@ export default function useRoller() {
431 throw new Error('Internal Error: Missing Wallet/Details');
419 throw new Error('Internal Error: Missing Wallet/Details');
432 }
420 }
433
421
434− const pointDetails = nonces[_point];
422+ const pointDetails = await api.getPoint(_point);
435− const operator =
423+ const proxy = getProxy(pointDetails.ownership!, _wallet.address);
436− getManagementNonce(pointDetails, _wallet.address) ||
424+
437− getOwnerNonce(pointDetails, _wallet.address);
438− if (operator === undefined)
425+ if (proxy === undefined)
439 throw new Error("Error: Address doesn't match proxy");
426 throw new Error("Error: Address doesn't match proxy");
427+
428+ const nonce = await api.getNonce({
429+ ship: _point,
430+ proxy: proxy,
431+ });
432+
440 const networkRevision = convertToInt(azimuthPoint.network.keys.life, 10);
433 const networkRevision = convertToInt(azimuthPoint.network.keys.life, 10);
441 const nextRevision = networkRevision + 1;
434 const nextRevision = networkRevision + 1;
442 const networkSeed = customNetworkSeed
435 const networkSeed = customNetworkSeed
@@ -454,8 +447,8 @@ export default function useRoller() {
454 api,
447 api,
455 _wallet,
448 _wallet,
456 _point,
449 _point,
457− operator.proxy!,
450+ proxy!,
458− operator.nonce!,
451+ nonce,
459 networkSeed,
452 networkSeed,
460 breach
453 breach
461 );
454 );
@@ -479,22 +472,10 @@ export default function useRoller() {
479 fromWallet,
472 fromWallet,
480 toWallet,
473 toWallet,
481 }: ReticketParams) => {
474 }: ReticketParams) => {
482− let pointDetails = nonces[point];
483 const azimuthPoint = await api.getPoint(point);
475 const azimuthPoint = await api.getPoint(point);
476+ const proxy = 'own';
477+ let nonce = await api.getNonce({ ship: point, proxy });
484
478
485− console.log(pointDetails);
486− if (pointDetails === undefined) {
487− // This is an invite acceptance
488− pointDetails = azimuthPoint.ownership!;
489− console.log(pointDetails);
490− }
491− const ownerAddress = pointDetails.owner?.address!;
492− const operator = pointDetails && getOwnerNonce(pointDetails, ownerAddress);
493−
494− if (operator === undefined)
495− throw new Error("Error: Address doesn't match proxy");
496−
497− let nonce = operator.nonce!;
498 let requests = [];
479 let requests = [];
499
480
500 // 1. Update networking keys
481 // 1. Update networking keys
@@ -508,12 +489,11 @@ export default function useRoller() {
508 api,
489 api,
509 fromWallet,
490 fromWallet,
510 point,
491 point,
511− operator.proxy!,
492+ proxy,
512 nonce,
493 nonce,
513 networkSeed
494 networkSeed
514 );
495 );
515 nonce = nonce + 1;
496 nonce = nonce + 1;
516− // increaseNonce(point, operator.proxy!);
517 requests.push(configureKeysRequest);
497 requests.push(configureKeysRequest);
518
498
519 // 2. Set Management Proxy
499 // 2. Set Management Proxy
@@ -521,13 +501,12 @@ export default function useRoller() {
521 api,
501 api,
522 fromWallet,
502 fromWallet,
523 point,
503 point,
524− operator.proxy!,
504+ proxy,
525 'manage',
505 'manage',
526 nonce,
506 nonce,
527 manager
507 manager
528 );
508 );
529 nonce = nonce + 1;
509 nonce = nonce + 1;
530− // increaseNonce(point, operator.proxy!);
531 requests.push(registerMgmtRequest);
510 requests.push(registerMgmtRequest);
532
511
533 // 3. Set Spawn Proxy
512 // 3. Set Spawn Proxy
@@ -536,13 +515,12 @@ export default function useRoller() {
536 api,
515 api,
537 fromWallet,
516 fromWallet,
538 point,
517 point,
539− operator.proxy!,
518+ proxy,
540 'spawn',
519 'spawn',
541 nonce,
520 nonce,
542 toWallet.spawn.keys.address
521 toWallet.spawn.keys.address
543 );
522 );
544 nonce = nonce + 1;
523 nonce = nonce + 1;
545− // increaseNonce(point, operator.proxy!);
546 requests.push(registerSpawnRequest);
524 requests.push(registerSpawnRequest);
547 }
525 }
548 // 4. Transfer point
526 // 4. Transfer point
@@ -550,12 +528,10 @@ export default function useRoller() {
550 api,
528 api,
551 fromWallet,
529 fromWallet,
552 point,
530 point,
553− operator.proxy!,
531+ proxy,
554 nonce,
532 nonce,
555 to
533 to
556 );
534 );
557− // increaseNonce(point, operator.proxy!);
558− setNonce(point, pointDetails, operator.proxy!, nonce);
559 requests.push(transferTxRequest);
535 requests.push(transferTxRequest);
560
536
561 const hashes = await Promise.all(requests);
537 const hashes = await Promise.all(requests);
@@ -572,21 +548,21 @@ export default function useRoller() {
572 throw new Error('Internal Error: Missing Wallet');
548 throw new Error('Internal Error: Missing Wallet');
573 }
549 }
574
550
575− const pointDetails = nonces[_point];
551+ const pointDetails = await api.getPoint(_point);
576− const operator =
577− getManagementNonce(pointDetails, _wallet.address) ||
578− getOwnerNonce(pointDetails, _wallet.address);
552+ const proxy = getProxy(pointDetails.ownership!, _wallet.address);
579
553
580− if (operator === undefined)
554+ if (proxy === undefined)
581 throw new Error("Error: Address doesn't match proxy");
555 throw new Error("Error: Address doesn't match proxy");
582
556
557+ const nonce = await api.getNonce({ ship: _point, proxy });
558+
583 const txHash = await registerProxyAddress(
559 const txHash = await registerProxyAddress(
584 api,
560 api,
585 _wallet,
561 _wallet,
586 _point,
562 _point,
587− operator.proxy!,
563+ proxy,
588 proxyType,
564 proxyType,
589− operator.nonce!,
565+ nonce,
590 address
566 address
591 );
567 );
592
568
@@ -594,7 +570,7 @@ export default function useRoller() {
594
570
595 return pendingTx;
571 return pendingTx;
596 },
572 },
597− [api, pointCursor, wallet, nonces]
573+ [api, pointCursor, wallet]
598 );
574 );
599
575
600 const transferPoint = useCallback(
576 const transferPoint = useCallback(
@@ -607,20 +583,20 @@ export default function useRoller() {
607 throw new Error('Internal Error: Missing Wallet');
583 throw new Error('Internal Error: Missing Wallet');
608 }
584 }
609
585
610− const pointDetails = nonces[_point];
586+ const pointDetails = await api.getPoint(_point);
611− const operator =
612− getTransferNonce(pointDetails, _wallet.address) ||
613− getOwnerNonce(pointDetails, _wallet.address);
587+ const proxy = getProxy(pointDetails.ownership!, _wallet.address);
614
588
615− if (operator === undefined)
589+ if (proxy === undefined)
616 throw new Error("Error: Address doesn't match proxy");
590 throw new Error("Error: Address doesn't match proxy");
617
591
592+ const nonce = await api.getNonce({ ship: _point, proxy });
593+
618 const txHash = await transferPointRequest(
594 const txHash = await transferPointRequest(
619 api,
595 api,
620 _wallet,
596 _wallet,
621 _point,
597 _point,
622− operator.proxy!,
598+ proxy,
623− operator.nonce!,
599+ nonce,
624 address,
600 address,
625 reset || false
601 reset || false
626 );
602 );
@@ -628,7 +604,7 @@ export default function useRoller() {
628
604
629 return pendingTx;
605 return pendingTx;
630 },
606 },
631− [api, pointCursor, wallet, nonces]
607+ [api, pointCursor, wallet]
632 );
608 );
633
609
634 // On load, get initial config
610 // On load, get initial config
src/lib/utils/nonce.tsdeleted−157
@@ -1,157 +0,0 @@
1−import { Ownership } from '@urbit/roller-api';
2−
3−export const getProxyAndNonce = (
4− owner: Ownership,
5− address: string
6−): { proxy?: string; nonce?: number } =>
7− owner.managementProxy?.address === address
8− ? { proxy: 'manage', nonce: owner.managementProxy.nonce }
9− : owner.owner?.address === address
10− ? { proxy: 'own', nonce: owner.owner.nonce }
11− : owner.spawnProxy?.address === address
12− ? { proxy: 'spawn', nonce: owner.spawn?.owner.nonce }
13− : owner.votingProxy?.address === address
14− ? { proxy: 'vote', nonce: owner.votingProxy?.owner.nonce }
15− : owner.transferProxy?.address === address
16− ? {
17− proxy: 'transfer',
18− nonce: owner.votingProxy?.nonce,
19− }
20− : { proxy: undefined, nonce: undefined };
21−
22−export const getManagementNonce = (
23− owner: Ownership,
24− address: string
25−): { nonce?: number; proxy?: string } | undefined =>
26− owner.managementProxy?.address === address
27− ? { nonce: owner.managementProxy.nonce, proxy: 'manage' }
28− : undefined;
29−
30−export const getTransferNonce = (
31− owner: Ownership,
32− address: string
33−): { nonce?: number; proxy?: string } | undefined =>
34− owner.transferProxy?.address === address
35− ? { nonce: owner.transferProxy.nonce, proxy: 'transfer' }
36− : undefined;
37−
38−export const getOwnerNonce = (
39− owner: Ownership,
40− address: string
41−): { nonce?: number; proxy?: string } | undefined =>
42− owner.owner?.address === address
43− ? { nonce: owner.owner.nonce, proxy: 'own' }
44− : undefined;
45−
46−export const getSpawnNonce = (
47− owner: Ownership,
48− address: string
49−): { nonce?: number; proxy?: string } | undefined =>
50− owner.spawnProxy?.address === address
51− ? { nonce: owner.spawnProxy.nonce, proxy: 'spawn' }
52− : undefined;
53−
54−export const getVotingNonce = (
55− owner: Ownership,
56− address: string
57−): { nonce?: number; proxy?: string } | undefined =>
58− owner.votingProxy?.address === address
59− ? { nonce: owner.votingProxy.nonce, proxy: 'vote' }
60− : undefined;
61−
62−export const increaseProxyNonce = (
63− owner: Ownership,
64− proxy: string
65−): Ownership | undefined =>
66− 'manage' === proxy
67− ? {
68− ...owner,
69− managementProxy: {
70− ...owner.managementProxy,
71− nonce: owner.managementProxy?.nonce
72− ? owner.managementProxy?.nonce + 1
73− : 1,
74− },
75− }
76− : 'own' === proxy
77− ? {
78− ...owner,
79− owner: {
80− ...owner.owner,
81− nonce: owner.owner?.nonce ? owner.owner?.nonce + 1 : 1,
82− },
83− }
84− : 'spawn' === proxy
85− ? {
86− ...owner,
87− spawnProxy: {
88− ...owner.spawnProxy,
89− nonce: owner.spawnProxy?.nonce ? owner.spawnProxy?.nonce + 1 : 1,
90− },
91− }
92− : 'vote' === proxy
93− ? {
94− ...owner,
95− votingProxy: {
96− ...owner.votingProxy,
97− nonce: owner.votingProxy?.nonce ? owner.votingProxy?.nonce + 1 : 1,
98− },
99− }
100− : 'transfer' === proxy
101− ? {
102− ...owner,
103− transferProxy: {
104− ...owner.transferProxy,
105− nonce: owner.transferProxy?.nonce
106− ? owner.transferProxy?.nonce + 1
107− : 1,
108− },
109− }
110− : undefined;
111−
112−export const setProxyNonce = (
113− owner: Ownership,
114− proxy: string,
115− nonce: number
116−): Ownership | undefined =>
117− 'manage' === proxy
118− ? {
119− ...owner,
120− managementProxy: {
121− ...owner.managementProxy,
122− nonce,
123− },
124− }
125− : 'own' === proxy
126− ? {
127− ...owner,
128− owner: {
129− ...owner.owner,
130− nonce,
131− },
132− }
133− : 'spawn' === proxy
134− ? {
135− ...owner,
136− spawnProxy: {
137− ...owner.spawnProxy,
138− nonce,
139− },
140− }
141− : 'vote' === proxy
142− ? {
143− ...owner,
144− votingProxy: {
145− ...owner.voteProxy,
146− nonce,
147− },
148− }
149− : 'transfer' === proxy
150− ? {
151− ...owner,
152− transferProxy: {
153− ...owner.transferProxy,
154− nonce,
155− },
156− }
157− : undefined;
src/lib/utils/proxy.tsnew file+17
@@ -0,0 +1,17 @@
1+import { Ownership } from '@urbit/roller-api';
2+
3+export const getProxy = (
4+ owner: Ownership,
5+ address: string
6+): string | undefined =>
7+ owner.managementProxy?.address === address
8+ ? 'manage'
9+ : owner.owner?.address === address
10+ ? 'own'
11+ : owner.spawnProxy?.address === address
12+ ? 'spawn'
13+ : owner.votingProxy?.address === address
14+ ? 'vote'
15+ : owner.transferProxy?.address === address
16+ ? 'transfer'
17+ : undefined;
src/store/roller.ts+1−39
@@ -1,13 +1,7 @@
1import create from 'zustand';
1import create from 'zustand';
2−import {
3− L2Point,
4− PendingTransaction,
2+import { L2Point, PendingTransaction } from '@urbit/roller-api';
5− Ownership,
6− Ship,
7−} from '@urbit/roller-api';
8
3
9import { HOUR, isL2, isL2Spawn } from 'lib/utils/roller';
4import { HOUR, isL2, isL2Spawn } from 'lib/utils/roller';
10−import { increaseProxyNonce, setProxyNonce } from 'lib/utils/nonce';
11import { Invite } from 'lib/types/Invite';
5import { Invite } from 'lib/types/Invite';
12
6
13export interface RollerStore {
7export interface RollerStore {
@@ -17,17 +11,6 @@ export interface RollerStore {
17 currentPoint: L2Point | null;
11 currentPoint: L2Point | null;
18 currentL2: boolean;
12 currentL2: boolean;
19 currentL2Spawn: boolean;
13 currentL2Spawn: boolean;
20− nonces: {
21− [point: Ship]: Ownership;
22− };
23− increaseNonce: (point: Ship, proxy: string) => void;
24− setNonce: (
25− point: Ship,
26− owner: Ownership,
27− proxy: string,
28− nonce: number
29− ) => void;
30− setNonces: (point: number, owner: Ownership) => void;
31 invites: Invite[];
14 invites: Invite[];
32 recentlyCompleted: number;
15 recentlyCompleted: number;
33 setNextBatchTime: (nextBatchTime: number) => void;
16 setNextBatchTime: (nextBatchTime: number) => void;
@@ -46,27 +29,6 @@ export const useRollerStore = create<RollerStore>(set => ({
46 currentL2Spawn: false,
29 currentL2Spawn: false,
47 invites: [],
30 invites: [],
48 recentlyCompleted: 0,
31 recentlyCompleted: 0,
49− nonces: {},
50− increaseNonce: (point: Ship, proxy: string) =>
51− set(state => {
52− const owner = increaseProxyNonce(state.nonces[point], proxy);
53− console.log(point, proxy, owner);
54− if (!owner) throw new Error("Can't increase nonce for this proxy");
55− return { ...state, nonces: { ...state.nonces, [point]: owner } };
56− }),
57− setNonce: (point: Ship, owner: Ownership, proxy: string, nonce: number) =>
58− set(state => {
59− const updatedOwner = setProxyNonce(owner, proxy, nonce);
60− if (!updatedOwner) throw new Error("Can't set nonce for this proxy");
61− return {
62− ...state,
63− nonces: { ...state.nonces, [point]: updatedOwner },
64− };
65− }),
66− setNonces: (point: Ship, owner: Ownership) =>
67− set(state => {
68− return { ...state, nonces: { ...state.nonces, [point]: owner } };
69− }),
70 setNextBatchTime: (nextBatchTime: number) => set(() => ({ nextBatchTime })),
32 setNextBatchTime: (nextBatchTime: number) => set(() => ({ nextBatchTime })),
71 setNextRoll: (nextRoll: string) => set(() => ({ nextRoll })),
33 setNextRoll: (nextRoll: string) => set(() => ({ nextRoll })),
72 setPendingTransactions: (pendingTransactions: PendingTransaction[]) =>
34 setPendingTransactions: (pendingTransactions: PendingTransaction[]) =>
src/views/Point/Point.tsx+4−12
@@ -45,8 +45,6 @@ export default function Point() {
45 nextRoll,
45 nextRoll,
46 invites,
46 invites,
47 setCurrentPoint,
47 setCurrentPoint,
48− setNonces,
49− increaseNonce,
50 } = useRollerStore();
48 } = useRollerStore();
51 const networkKeysSet = useHasNetworkKeysSet();
49 const networkKeysSet = useHasNetworkKeysSet();
52 const [showModal, setShowModal] = useState(false);
50 const [showModal, setShowModal] = useState(false);
@@ -64,23 +62,16 @@ export default function Point() {
64 const loadL2Info = useCallback(async () => {
62 const loadL2Info = useCallback(async () => {
65 const getTransactions = async () => {
63 const getTransactions = async () => {
66 const pointInfo = await api.getPoint(Number(point));
64 const pointInfo = await api.getPoint(Number(point));
67− const pendingTxs = await api.getPendingByShip(Number(point));
65+
68 if (isDevelopment) {
66 if (isDevelopment) {
69 console.log('POINT INFO', pointInfo);
67 console.log('POINT INFO', pointInfo);
70 }
68 }
71− setNonces(point, pointInfo.ownership);
72−
73− for (let index = 0; index < pendingTxs.length; index++) {
74− const proxy = pendingTxs[index].rawTx?.from?.proxy;
75− console.log(pointInfo.ownership, proxy);
76− increaseNonce(point, proxy);
77− }
78 setCurrentPoint(pointInfo);
69 setCurrentPoint(pointInfo);
79 await getInvites(isL2(pointInfo.dominion));
70 await getInvites(isL2(pointInfo.dominion));
80 };
71 };
81
72
82 await getTransactions();
73 await getTransactions();
83− }, [api, point, setCurrentPoint, increaseNonce, getInvites, setNonces]);
74+ }, [api, point, getInvites, setCurrentPoint]);
84
75
85 useEffect(() => {
76 useEffect(() => {
86 loadL1Info();
77 loadL1Info();
@@ -148,7 +139,6 @@ export default function Point() {
148 </>
139 </>
149 );
140 );
150 })();
141 })();
151−
152 const address = need.addressFromWallet(wallet);
142 const address = need.addressFromWallet(wallet);
153 const spawnedPending = pendingTransactions.filter(
143 const spawnedPending = pendingTransactions.filter(
154 ({ rawTx }) => rawTx?.tx?.type === 'spawn'
144 ({ rawTx }) => rawTx?.tx?.type === 'spawn'
@@ -197,6 +187,8 @@ export default function Point() {
197 ? 'Management Address Changed'
187 ? 'Management Address Changed'
198 : pendingTx.rawTx?.tx?.type === 'configure-keys'
188 : pendingTx.rawTx?.tx?.type === 'configure-keys'
199 ? 'Network Keys Configured'
189 ? 'Network Keys Configured'
190+ : pendingTx.rawTx?.tx?.type === 'transfer-point'
191+ ? 'Point Transfered'
200 : ''}
192 : ''}
201 </div>
193 </div>
202 <div className="rollup-timer">
194 <div className="rollup-timer">
src/views/UrbitID/SetProxy.js−1
@@ -161,7 +161,6 @@ export default function SetProxy() {
161 ]);
161 ]);
162
162
163 const validateForm = useCallback((values, errors) => {
163 const validateForm = useCallback((values, errors) => {
164− console.log('hola');
165 if (!values.unset && errors.address) {
164 if (!values.unset && errors.address) {
166 return errors;
165 return errors;
167 }
166 }