Skip to content

Commit

Permalink
domains key migration
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Dec 30, 2024
1 parent 863ef47 commit 13248a0
Show file tree
Hide file tree
Showing 7 changed files with 1,306 additions and 33 deletions.
1 change: 1 addition & 0 deletions smart-contract/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
11 changes: 5 additions & 6 deletions smart-contract/assembly/contracts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,20 +294,19 @@ export function dnsReverseResolve(args: StaticArray<u8>): StaticArray<u8> {

assert(keys.length > 0, 'No domain found for the address');

let domains = new StaticArray<u8>(0);
let domains: u8[] = [];

for (let i = 0; i < keys.length; i++) {
const domain: StaticArray<u8> = StaticArray.fromArray(
keys[i].slice(prefix.length),
);
const domain = keys[i].slice(prefix.length);

domains = domains.concat(domain);

if (i < keys.length - 1) {
domains = domains.concat(stringToBytes(','));
domains.push(44 /* coma */);
}
}

return domains;
return StaticArray.fromArray(domains);
}

/**
Expand Down
Loading

0 comments on commit 13248a0

Please sign in to comment.