"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const KeyType_1 = require("@wireio/sdk-core/chain/KeyType");
describe("KeyType", () => {
    test("enum values exist", () => {
        expect(KeyType_1.KeyType.K1).toBe("K1");
        expect(KeyType_1.KeyType.R1).toBe("R1");
        expect(KeyType_1.KeyType.WA).toBe("WA");
        expect(KeyType_1.KeyType.EM).toBe("EM");
        expect(KeyType_1.KeyType.ED).toBe("ED");
    });
    test("indexFor returns correct index for K1", () => {
        expect(KeyType_1.KeyType.indexFor(KeyType_1.KeyType.K1)).toBe(0);
    });
    test("indexFor returns correct index for R1", () => {
        expect(KeyType_1.KeyType.indexFor(KeyType_1.KeyType.R1)).toBe(1);
    });
    test("indexFor returns correct index for WA", () => {
        expect(KeyType_1.KeyType.indexFor(KeyType_1.KeyType.WA)).toBe(2);
    });
    test("indexFor returns correct index for EM", () => {
        expect(KeyType_1.KeyType.indexFor(KeyType_1.KeyType.EM)).toBe(3);
    });
    test("indexFor returns correct index for ED", () => {
        expect(KeyType_1.KeyType.indexFor(KeyType_1.KeyType.ED)).toBe(4);
    });
    test("from number 0 returns K1", () => {
        expect(KeyType_1.KeyType.from(0)).toBe(KeyType_1.KeyType.K1);
    });
    test("from number 1 returns R1", () => {
        expect(KeyType_1.KeyType.from(1)).toBe(KeyType_1.KeyType.R1);
    });
    test("from string K1 returns K1", () => {
        expect(KeyType_1.KeyType.from("K1")).toBe(KeyType_1.KeyType.K1);
    });
    test("from string R1 returns R1", () => {
        expect(KeyType_1.KeyType.from("R1")).toBe(KeyType_1.KeyType.R1);
    });
    test("from unknown number throws", () => {
        expect(() => KeyType_1.KeyType.from(99)).toThrow("Unknown curve type");
    });
});
//# sourceMappingURL=KeyType.test.js.map