diff --git a/nym-api/tests/functional_test/circulating_supply/circulating-supply.test.ts b/nym-api/tests/functional_test/circulating_supply/circulating-supply.test.ts index c74d039175..b09d56df75 100644 --- a/nym-api/tests/functional_test/circulating_supply/circulating-supply.test.ts +++ b/nym-api/tests/functional_test/circulating_supply/circulating-supply.test.ts @@ -1,12 +1,9 @@ -import ConfigHandler from "../../src/config/configHandler"; import ContractCache from "../../src/endpoints/CirculatingSupply"; let contract: ContractCache; -let config: ConfigHandler; describe("Get circulating supply", (): void => { beforeAll(async (): Promise => { contract = new ContractCache(); - config = ConfigHandler.getInstance(); }); it("Get circulating supply amounts", async (): Promise => { diff --git a/nym-api/tests/functional_test/contract_cache/contract-cache-epochs.test.ts b/nym-api/tests/functional_test/contract_cache/contract-cache-epochs.test.ts index 482817f669..a2923e9c52 100644 --- a/nym-api/tests/functional_test/contract_cache/contract-cache-epochs.test.ts +++ b/nym-api/tests/functional_test/contract_cache/contract-cache-epochs.test.ts @@ -1,13 +1,10 @@ import ContractCache from "../../src/endpoints/ContractCache"; -import ConfigHandler from "../../src/config/configHandler"; let contract: ContractCache; -let config: ConfigHandler; describe("Get epoch info", (): void => { beforeAll(async (): Promise => { contract = new ContractCache(); - config = ConfigHandler.getInstance(); }); it("Get epoch reward params", async (): Promise => { diff --git a/nym-api/tests/functional_test/contract_cache/gateway/contract-cache-gateway.test.ts b/nym-api/tests/functional_test/contract_cache/gateway/contract-cache-gateway.test.ts index d83cdc20cd..e1dc896ad9 100644 --- a/nym-api/tests/functional_test/contract_cache/gateway/contract-cache-gateway.test.ts +++ b/nym-api/tests/functional_test/contract_cache/gateway/contract-cache-gateway.test.ts @@ -1,13 +1,10 @@ import ContractCache from "../../../src/endpoints/ContractCache"; -import ConfigHandler from "../../../src/config/configHandler"; let contract: ContractCache; -let config: ConfigHandler; describe("Get gateway data", (): void => { beforeAll(async (): Promise => { contract = new ContractCache(); - config = ConfigHandler.getInstance(); }); it("Get all gateways", async (): Promise => { @@ -42,7 +39,7 @@ describe("Get gateway data", (): void => { const response = await contract.getBlacklistedGateways(); if (response === null) { // no blacklisted gateways returns an empty array - expect(response).toBeNull(); + expect(response).toBeNull(); } else { response.forEach(function (value) { expect(typeof value).toBe("string"); diff --git a/nym-api/tests/functional_test/contract_cache/mixnode/contract-cache-mixnode.test.ts b/nym-api/tests/functional_test/contract_cache/mixnode/contract-cache-mixnode.test.ts index 33d6f0e97f..af1a40b297 100644 --- a/nym-api/tests/functional_test/contract_cache/mixnode/contract-cache-mixnode.test.ts +++ b/nym-api/tests/functional_test/contract_cache/mixnode/contract-cache-mixnode.test.ts @@ -238,7 +238,7 @@ describe("Get mixnode data", (): void => { const response = await contract.getBlacklistedMixnodes(); if (response === null) { // no blacklisted mixnodes returns an empty array - expect(response).toBeNull();; + expect(response).toBeNull(); } else { response.forEach(function (value) { expect(typeof value).toBe("string"); diff --git a/nym-api/tests/functional_test/contract_cache/services.test.ts b/nym-api/tests/functional_test/contract_cache/services.test.ts index d38adf9d9d..711aaa0246 100644 --- a/nym-api/tests/functional_test/contract_cache/services.test.ts +++ b/nym-api/tests/functional_test/contract_cache/services.test.ts @@ -1,28 +1,24 @@ import ContractCache from "../../src/endpoints/ContractCache"; -import ConfigHandler from "../../src/config/configHandler"; - let contract: ContractCache; -let config: ConfigHandler; describe("Get service provider info", (): void => { - beforeAll(async (): Promise => { - contract = new ContractCache(); - config = ConfigHandler.getInstance(); - }); + beforeAll(async (): Promise => { + contract = new ContractCache(); + }); - it("Get service providers", async (): Promise => { - const response = await contract.getServiceProviders(); - if ("[service_id]" in response) { - response.services.forEach((x) => { - expect(typeof x.service.nym_address.address).toBe("string"); - expect(typeof x.service.service_type).toBe("string"); - expect(typeof x.service.block_height).toBe("number"); - expect(typeof x.service.announcer).toBe("string"); - expect(typeof x.service.deposit.amount).toBe("string"); - expect(typeof x.service.deposit.denom).toBe("string"); - }); - } else if ("[ ]" in response) { - return; - } - }); -}); \ No newline at end of file + it("Get service providers", async (): Promise => { + const response = await contract.getServiceProviders(); + if ("[service_id]" in response) { + response.services.forEach((x) => { + expect(typeof x.service.nym_address.address).toBe("string"); + expect(typeof x.service.service_type).toBe("string"); + expect(typeof x.service.block_height).toBe("number"); + expect(typeof x.service.announcer).toBe("string"); + expect(typeof x.service.deposit.amount).toBe("string"); + expect(typeof x.service.deposit.denom).toBe("string"); + }); + } else if ("[ ]" in response) { + return; + } + }); +}); diff --git a/nym-api/tests/functional_test/status/status-gateway.test.ts b/nym-api/tests/functional_test/status/status-gateway.test.ts index 92435e12d3..71f2becc6d 100644 --- a/nym-api/tests/functional_test/status/status-gateway.test.ts +++ b/nym-api/tests/functional_test/status/status-gateway.test.ts @@ -40,7 +40,9 @@ describe("Get gateway data", (): void => { expect(identity_key).toStrictEqual(response.identity); expect(typeof response.owner).toBe("string"); } else if ("message" in response) { - expect(response.message).toContain("could not find uptime history associated with gateway"); + expect(response.message).toContain( + "could not find uptime history associated with gateway" + ); } }); @@ -58,7 +60,9 @@ describe("Get gateway data", (): void => { expect(identity_key).toStrictEqual(response.identity); expect(typeof response.count).toBe("number"); } else if ("message" in response) { - expect(response.message).toContain("could not find uptime history associated with mixnode"); + expect(response.message).toContain( + "could not find uptime history associated with mixnode" + ); } }); diff --git a/nym-api/tests/functional_test/status/status-mixnode.test.ts b/nym-api/tests/functional_test/status/status-mixnode.test.ts index aaa8054057..6590843f02 100644 --- a/nym-api/tests/functional_test/status/status-mixnode.test.ts +++ b/nym-api/tests/functional_test/status/status-mixnode.test.ts @@ -55,7 +55,9 @@ describe("Get mixnode data", (): void => { expect(identity_key).toStrictEqual(response.mix_id); expect(typeof response.owner).toBe("string"); } else if ("message" in response) { - expect(response.message).toContain("could not find uptime history associated with mixnode"); + expect(response.message).toContain( + "could not find uptime history associated with mixnode" + ); } }); @@ -70,7 +72,9 @@ describe("Get mixnode data", (): void => { const identity_key = config.environmnetConfig.mix_id; const response = await status.getMixnodeRewardComputation(identity_key); if ("estimation" in response) { - expect(response.reward_params.interval.sybil_resistance).toStrictEqual("0.3"); + expect(response.reward_params.interval.sybil_resistance).toStrictEqual( + "0.3" + ); expect(response.reward_params.active_set_size).toStrictEqual(240); expect(typeof response.reward_params.interval.reward_pool).toBe("string"); } else if ("message" in response) { @@ -108,7 +112,9 @@ describe("Get mixnode data", (): void => { const response = await status.getUnfilteredMixnodes(); response.forEach((x) => { expect(typeof x.stake_saturation).toBe("string"); - expect(typeof x.mixnode_details.rewarding_details.last_rewarded_epoch).toBe("number"); + expect( + typeof x.mixnode_details.rewarding_details.last_rewarded_epoch + ).toBe("number"); }); }); @@ -116,7 +122,9 @@ describe("Get mixnode data", (): void => { const identity_key = config.environmnetConfig.mix_id; const response = await status.getMixnodeStatus(identity_key); const unfiltered_mixnodes_response = await status.getUnfilteredMixnodes(); - const mixnode = unfiltered_mixnodes_response.find(x => x.mixnode_details.bond_information.mix_id === identity_key); + const mixnode = unfiltered_mixnodes_response.find( + (x) => x.mixnode_details.bond_information.mix_id === identity_key + ); if (mixnode) { expect(response.status).toStrictEqual("active"); } else { @@ -127,7 +135,9 @@ describe("Get mixnode data", (): void => { it("Get all rewarded mixnodes", async (): Promise => { const response = await status.getDetailedRewardedMixnodes(); response.forEach((x) => { - expect(typeof x.mixnode_details.rewarding_details.last_rewarded_epoch).toBe("number"); + expect( + typeof x.mixnode_details.rewarding_details.last_rewarded_epoch + ).toBe("number"); }); }); @@ -146,7 +156,9 @@ describe("Get mixnode data", (): void => { it("with correct data", async (): Promise => { const mix_id = config.environmnetConfig.mix_id; - const response = await status.sendMixnodeRewardEstimatedComputation(mix_id); + const response = await status.sendMixnodeRewardEstimatedComputation( + mix_id + ); expect(typeof response.estimation.delegates).toBe("string"); }); }); diff --git a/nym-api/tests/src/types/ContractCacheTypes.ts b/nym-api/tests/src/types/ContractCacheTypes.ts index f3cf31e401..e66c3018a8 100644 --- a/nym-api/tests/src/types/ContractCacheTypes.ts +++ b/nym-api/tests/src/types/ContractCacheTypes.ts @@ -125,7 +125,7 @@ export interface EpochLength { } export interface ServiceProviders { - services: (Services)[]; + services: Services[]; } export interface Services { service_id: number; @@ -145,4 +145,3 @@ export interface Deposit { denom: string; amount: string; } -