diff options
Diffstat (limited to 'lib/wallet/emscriptif-test.ts')
-rw-r--r-- | lib/wallet/emscriptif-test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/wallet/emscriptif-test.ts b/lib/wallet/emscriptif-test.ts index a3a9229bb..ddafa32bc 100644 --- a/lib/wallet/emscriptif-test.ts +++ b/lib/wallet/emscriptif-test.ts @@ -9,3 +9,13 @@ test("string hashing", (t: TestLib) => { t.assert(h === hc, "must equal"); t.pass(); }); + +test("signing", (t: TestLib) => { + let x = native.ByteArray.fromStringWithNull("hello taler"); + let priv = native.EddsaPrivateKey.create(); + let pub = priv.getPublicKey(); + let purpose = new native.EccSignaturePurpose(native.SignaturePurpose.TEST, x); + let sig = native.eddsaSign(purpose, priv); + t.assert(native.eddsaVerify(native.SignaturePurpose.TEST, purpose, sig, pub)); + t.pass(); +}); |