Skip to content

Commit

Permalink
Add namehash and tokenId to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
DancingAxolotl committed Feb 7, 2023
1 parent 408382b commit 6c6b64d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Foundation

public struct TokenUriMetadata: Codable {
let name: String?
let tokenId: String?
let namehash: String?
let description: String?
let externalUrl: String?
let image: String?
Expand All @@ -14,6 +16,8 @@ public struct TokenUriMetadata: Codable {

enum CodingKeys: String, CodingKey {
case name
case tokenId
case namehash
case description
case externalUrl = "external_url"
case image
Expand Down
2 changes: 2 additions & 0 deletions Tests/ResolutionTests/ResolutionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,11 @@ class ResolutionTests: XCTestCase {

waitForExpectations(timeout: timeout, handler: nil)

let domainNamehash = try resolution.namehash(domain: TestHelpers.getTestDomain(.WALLET_DOMAIN))
// Then
assert(tokenURIMetadata?.name == TestHelpers.getTestDomain(.WALLET_DOMAIN))
assert(tokenURIMetadata?.attributes.count == 5)
assert(tokenURIMetadata?.namehash == domainNamehash)
TestHelpers.checkError(result: unregisteredResult, expectedError: ResolutionError.unregisteredDomain)
}

Expand Down

0 comments on commit 6c6b64d

Please sign in to comment.