Skip to content

Commit

Permalink
reverseResolve return empty list instead of throw
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Dec 31, 2024
1 parent 0871ccc commit a2ede4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion smart-contract/assembly/__tests__/dns.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ describe('Test dnsReverseResolve', () => {
stringToBytes(domain),
);
});
throws('Test reverse resolve after free', () => {
test('Test reverse resolve after free', () => {
let args = new Args();
args.add(domain);
args.add(target);
Expand Down
4 changes: 1 addition & 3 deletions smart-contract/assembly/contracts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const COUNTER_KEY: StaticArray<u8> = [0x00];
const TOKEN_ID_KEY_PREFIX: StaticArray<u8> = [0x01];
const TARGET_KEY_PREFIX: StaticArray<u8> = [0x02];
const DOMAIN_KEY_PREFIX: StaticArray<u8> = [0x03];
const ADDRESS_KEY_PREFIX: StaticArray<u8> = [0x04];
// const ADDRESS_KEY_PREFIX: StaticArray<u8> = [0x04];
const LOCKED_KEY_PREFIX: StaticArray<u8> = [0x05];
const ADDRESS_KEY_PREFIX_V2: StaticArray<u8> = [0x06];

Expand Down Expand Up @@ -293,8 +293,6 @@ export function dnsReverseResolve(args: StaticArray<u8>): StaticArray<u8> {
const prefix = targetToDomainKeyPrefix(targetAddress);
const keys = getKeys(prefix);

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

const prefixLength = prefix.length;
let domains: u8[] = [];

Expand Down

0 comments on commit a2ede4f

Please sign in to comment.