Skip to content

Commit

Permalink
Add test for default init sig (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim authored Jul 23, 2021
1 parent f714065 commit 19f6db4
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/serialization.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,26 @@
# This file may not be copied, modified, or distributed except according to
# those terms.

import ../blscurve
import ../blscurve, std/strutils

# Infinite signatures serialization
# A signature may be initialized at an infinity point
# as a first step before aggregation. Inputs

echo "\nZero init signatures is serialized as infinity point"
echo "----------------------------------\n"

proc test_zero_sig() =

block:
let sig = Signature()
doAssert sig.toHex() == "c" & '0'.repeat(191)

block:
let sig = AggregateSignature()
doAssert sig.toHex() == "c" & '0'.repeat(191)

test_zero_sig()

# This test ensures that serialization roundtrips work

Expand Down

0 comments on commit 19f6db4

Please sign in to comment.