diff --git a/tests/codex/merkletree/testcodextree.nim b/tests/codex/merkletree/testcodextree.nim index d08b5a14..ace612f5 100644 --- a/tests/codex/merkletree/testcodextree.nim +++ b/tests/codex/merkletree/testcodextree.nim @@ -51,7 +51,7 @@ suite "Test CodexTree": var tree = CodexTree.init(leaves = expectedLeaves) check: tree.isOk - tree.get().leaves == expectedLeaves.mapIt( it.bytes ) + tree.get().leaves == expectedLeaves.mapIt( it.digestBytes ) tree.get().mcodec == sha256 test "Should build tree from cid leaves": @@ -68,10 +68,10 @@ suite "Test CodexTree": check: tree.isOk - tree.get().leaves == expectedLeaves.mapIt( it.mhash.tryGet.bytes ) + tree.get().leaves == expectedLeaves.mapIt( it.mhash.tryGet.digestBytes ) tree.get().mcodec == sha256 - test "Should build from raw bytes (should not hash leaves)": + test "Should build from raw digestbytes (should not hash leaves)": let tree = CodexTree.init(sha256, leaves = data).tryGet @@ -91,7 +91,7 @@ suite "Test CodexTree": tree == fromNodes let - mhash = sha256.getMhash().tryGet + mhash = sha256.mhash().tryGet zero: seq[byte] = newSeq[byte](mhash.size) compress = proc(x, y: seq[byte], key: ByteTreeKey): seq[byte] = compress(x, y, key, mhash).tryGet diff --git a/tests/codex/merkletree/testposeidon2tree.nim b/tests/codex/merkletree/testposeidon2tree.nim index 7076b5e7..72fa38cd 100644 --- a/tests/codex/merkletree/testposeidon2tree.nim +++ b/tests/codex/merkletree/testposeidon2tree.nim @@ -29,11 +29,10 @@ const "0000000000000000000000000000006".toBytes, "0000000000000000000000000000007".toBytes, "0000000000000000000000000000008".toBytes, - "0000000000000000000000000000009".toBytes, - "0000000000000000000000000000010".toBytes, + "0000000000000000000000000000009".toBytes, # note one less to account for padding of field elements ] -suite "Test CodexTree": +suite "Test Poseidon2Tree": var expectedLeaves: seq[Poseidon2Hash] @@ -54,8 +53,8 @@ suite "Test CodexTree": test "Init tree from byte leaves": let tree = Poseidon2Tree.init( - leaves = data.mapIt( - array[31, byte].initCopyFrom( it ) + leaves = expectedLeaves.mapIt( + array[31, byte].initCopyFrom( it.toBytes ) )).tryGet check: