Skip to content

Commit

Permalink
test: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iluxonchik committed Dec 10, 2023
1 parent 102e72b commit 3df8b7a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
23 changes: 21 additions & 2 deletions contracts/src/tests/api/ZKCoordinates.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ZKCoordinate, ZKLatitude, ZKLongitude } from "../../api/api";
import { ZKCoordinate, ZKLatitude, ZKLongitude } from "../../api/Models";

describe('ZKCoordinate, ZKLatitude, and ZKLongitude Tests', () => {
it('testZKCoordinateWithValidNumber', () => {
Expand Down Expand Up @@ -33,4 +33,23 @@ describe('ZKCoordinate, ZKLatitude, and ZKLongitude Tests', () => {
const value = -190; // Invalid longitude value
expect(() => new ZKLongitude(value)).toThrow();
});
});
});/*
This contains the API for zkLocus. The API is designed to abstract away the underlying zero-knowledge circutiry logic, and focus
on providing a clear, concise and intuitive API for the end user. The API is designed adehering to the vision of zkLocus of allowing
for the sharing of optionally private geolocation data, that is extendable, customizable, and interoperable across the varioius
computational environments, such as blockchain (on-chain), off-chain, mobile, web and IoT.
The API's design levarages the recursive zkSNARKs architecture o zkLocus to its fullest extent. As such, the proofs are
naturally recursive and combinable with one another, just like in the low-level zkLocus API.
This API is designed specifically for TypeScript, and it's inspired by APIs in the Python ecosystem such as BeautifulSoup, where powerful
and complex functionality is abstracted away from the user, while exposing a clear and concise interface to the end user.
*/
// Utility Types
export type numberType = number | string; // Represents the number type
// Named Tuple Equivalent in TypeScript
export interface RawCoordinates {
latitude: numberType;
longitude: numberType;
}

3 changes: 1 addition & 2 deletions contracts/src/tests/api/ZKGeoPoint.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Int64 } from "o1js";
import { ZKGeoPoint, ZKLatitude, ZKLongitude } from "../../api/api";
import { ZKGeoPoint, ZKLatitude, ZKLongitude } from "../../api/Models";
import { GeoPoint } from "../../model/Geography";

describe('ZKGeoPoint Class Tests', () => {
Expand Down
3 changes: 2 additions & 1 deletion contracts/src/tests/api/ZKNumber.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Int64 } from "o1js";
import { ZKNumber } from "../../api/api";
import { ZKNumber } from "../../api/Models";

describe('ZKNumber Class Tests', () => {
it('testZKNumberConstructionWithValueTypeNumber', () => {
Expand Down Expand Up @@ -34,3 +34,4 @@ describe('ZKNumber Class Tests', () => {
expect(zkNumber.toZKValue()).toEqual(Int64.from(Math.round(value)));
});
});

3 changes: 2 additions & 1 deletion contracts/src/tests/api/ZKThreePointPolygon.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ZKThreePointPolygon, ZKGeoPoint, ZKLatitude, ZKLongitude, RawCoordinates } from "../../api/api";
import { RawCoordinates } from "../../api/Types";
import { ZKThreePointPolygon, ZKGeoPoint, ZKLatitude, ZKLongitude } from "../../api/Models";
import { ThreePointPolygon } from "../../model/Geography";

describe('ZKThreePointPolygon Class Tests', () => {
Expand Down

0 comments on commit 3df8b7a

Please sign in to comment.