Skip to content

Commit

Permalink
fix(handlers): switch eth validation to set record validation
Browse files Browse the repository at this point in the history
  • Loading branch information
atticusofsparta committed Jan 31, 2025
1 parent d138448 commit c602167
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/state/actions/dispatchArNSUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,25 @@ export function dispatchArNSUpdate({
const handlers = await queryClient.fetchQuery({
queryKey: ['handlers', id, aoNetworkSettings.ANT],
queryFn: async () => {
// validate transfer supports eth addresses
const dryTransferRes = await antAo
// validate transfer supports eth addresses and single char undername fix
const drySetRecordRes = await antAo
.dryrun({
process: id,
Owner: walletAddress.toString(),
From: walletAddress.toString(),
tags: [
{ name: 'Action', value: 'Transfer' },
{ name: 'Recipient', value: '0x'.padEnd(42, '0') },
{ name: 'Action', value: 'Set-Record' },
{ name: 'Sub-Domain', value: 'a' },
{ name: 'Transaction-Id', value: 'test-'.padEnd(43, '1') },
{ name: 'TTL-Seconds', value: '900' },
],
})
.catch(() => {
return {} as ReturnType<typeof ao.dryrun>;
});

const hasError =
dryTransferRes.Messages.find((msg) => {
drySetRecordRes.Messages.find((msg) => {
return msg.Tags.find((t: Tag) => t.name === 'Error');
}) !== undefined;

Expand Down

0 comments on commit c602167

Please sign in to comment.