diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-13 23:30:18 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-13 23:31:17 +0100 |
commit | f3fb8be7db6de87dae40d41bd5597a735c800ca1 (patch) | |
tree | 1a061db04de8f5bb5a6b697fa56a9948f67fac2f /lib/wallet/emscriptif-test.ts | |
parent | 200d83c3886149ebb3f018530302079e12a81f6b (diff) | |
download | wallet-core-f3fb8be7db6de87dae40d41bd5597a735c800ca1.tar.xz |
restructuring
Diffstat (limited to 'lib/wallet/emscriptif-test.ts')
-rw-r--r-- | lib/wallet/emscriptif-test.ts | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/wallet/emscriptif-test.ts b/lib/wallet/emscriptif-test.ts deleted file mode 100644 index ddafa32bc..000000000 --- a/lib/wallet/emscriptif-test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {test, TestLib} from "testlib/talertest"; -import * as native from "./emscriptif"; - -test("string hashing", (t: TestLib) => { - let x = native.ByteArray.fromStringWithNull("hello taler"); - let h = "8RDMADB3YNF3QZBS3V467YZVJAMC2QAQX0TZGVZ6Q5PFRRAJFT70HHN0QF661QR9QWKYMMC7YEMPD679D2RADXCYK8Y669A2A5MKQFR" - let hc = x.hash().toCrock(); - console.log(`# hc ${hc}`); - 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(); -}); |