diff --git a/src/entity/investor.ts b/src/entity/investor.ts index 9e95dc1..1e6fe92 100644 --- a/src/entity/investor.ts +++ b/src/entity/investor.ts @@ -1,4 +1,4 @@ -import { Bytes } from "@graphprotocol/graph-ts" +import { Bytes } from "@graphprotocol/graph-ts" import { Investor } from "../../generated/schema" export function getInvestor(accountAddress: Bytes): Investor { diff --git a/tests/utils/time.test.ts b/tests/utils/time.test.ts deleted file mode 100644 index a68a698..0000000 --- a/tests/utils/time.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { assert, test, describe } from "matchstick-as/assembly/index" -import { BigInt } from "@graphprotocol/graph-ts" -import { DAY, HOUR, MONTH, QUARTER, WEEK, YEAR, getIntervalFromTimestamp, getPreviousIntervalFromTimestamp } from "../../src/utils/time" - -describe("time.getIntervalFromTimestamp", () => { - test("Support all the different periods", () => { - const timestamp = BigInt.fromString("1712744972") - - // simple periods - let res = getIntervalFromTimestamp(timestamp, HOUR) - assert.assertTrue(res.equals(BigInt.fromString("1712743200"))) - - res = getIntervalFromTimestamp(timestamp, DAY) - assert.assertTrue(res.equals(BigInt.fromString("1712707200"))) - - res = getIntervalFromTimestamp(timestamp, WEEK) - assert.assertTrue(res.equals(BigInt.fromString("1712448000"))) - - res = getIntervalFromTimestamp(timestamp, MONTH) - assert.assertTrue(res.equals(BigInt.fromString("1711929600"))) - - res = getIntervalFromTimestamp(timestamp, QUARTER) - assert.assertTrue(res.equals(BigInt.fromString("1711929600"))) - - res = getIntervalFromTimestamp(timestamp, YEAR) - assert.assertTrue(res.equals(BigInt.fromString("1704067200"))) - }) - - test("can query the previous interval as well", () => { - const timestamp = BigInt.fromString("1712744972") - - // simple periods - let res = getPreviousIntervalFromTimestamp(timestamp, HOUR) - assert.assertTrue(res.equals(BigInt.fromString("1712739600"))) - - res = getPreviousIntervalFromTimestamp(timestamp, DAY) - assert.assertTrue(res.equals(BigInt.fromString("1712620800"))) - - res = getPreviousIntervalFromTimestamp(timestamp, WEEK) - assert.assertTrue(res.equals(BigInt.fromString("1711843200"))) - - res = getPreviousIntervalFromTimestamp(timestamp, MONTH) - assert.assertTrue(res.equals(BigInt.fromString("1709251200"))) - - res = getPreviousIntervalFromTimestamp(timestamp, QUARTER) - assert.assertTrue(res.equals(BigInt.fromString("1704067200"))) - - res = getPreviousIntervalFromTimestamp(timestamp, YEAR) - assert.assertTrue(res.equals(BigInt.fromString("1672531200"))) - }) -})