UNPKG

postchain-client

Version:

Client library for accessing a Postchain node through REST.

22 lines 1.33 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import { toString } from "../../src/formatter"; import { gtvHash } from "../../src/gtv"; describe("Ordered arrays hashin comparison", () => { it("comparison of hash results", () => __awaiter(void 0, void 0, void 0, function* () { const array1 = ["a", "b"]; const array2 = ["b", "a"]; const orderedArray1Hashed = gtvHash(array1.sort(), 2); const orderedArray2Hashed = gtvHash(array2.sort(), 2); expect(orderedArray1Hashed.compare(orderedArray2Hashed)).toBe(0); expect(toString(orderedArray1Hashed)).toStrictEqual(toString(orderedArray2Hashed)); })); }); //# sourceMappingURL=setOrdering.test.js.map