Canonical empty memo test (#112)

This commit is contained in:
Francisco Gindre 2020-04-28 15:30:57 -03:00 committed by GitHub
parent 36f2d0730a
commit 1d71bc30c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,13 @@ class MemoTests: XCTestCase {
XCTAssertNil(emptyMemoData.asZcashTransactionMemo())
}
/**
test canonical memos
*/
func testCanonicalBlankMemos() throws {
XCTAssertNil(Self.canonicalEmptyMemo().asZcashTransactionMemo())
}
/**
*******
* mocked memos
@ -75,6 +82,12 @@ class MemoTests: XCTestCase {
static let expectedEmojiMemoString = "💕💕💕🦓🦓🦓🛡🛡🛡"
static func canonicalEmptyMemo() -> Data {
var bytes = [UInt8](repeating: 0, count: 512)
bytes[0] = UInt8(0xF6)
return Data(bytes: &bytes, count: 512)
}
static func randomMemoData() -> Data? {
let length: Int = 512
var keyData = Data(count: length)