-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change legacyMetadataHost to metadataHost for getOrSetSapphireMetadataNonce() function. add test for hexEncodedToString()
- Loading branch information
1 parent
3655710
commit feb727b
Showing
4 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Foundation | ||
@testable import TorusUtils | ||
import XCTest | ||
|
||
class HexEndodedTest: XCTestCase { | ||
func testOddAndEvenStrings() throws { | ||
let odd = "6F6464".hexEncodedToString() | ||
let even = "6576656E".hexEncodedToString() | ||
let extra_zero_padded = "06576656E".hexEncodedToString() | ||
let double_padded = "00006576656E".hexEncodedToString() | ||
let unpadded = "56E".hexEncodedToString() | ||
|
||
XCTAssertEqual(odd, "odd") // 6F 64 64 | ||
XCTAssertEqual(even, "even") // 65 76 65 6E | ||
XCTAssertEqual(extra_zero_padded, "even") // 00 65 76 65 6E | ||
XCTAssertEqual(double_padded, "even") // 00 00 65 76 65 6E | ||
XCTAssertEqual(unpadded, "\u{5}n") // 05 6E | ||
} | ||
} |