-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b615f5e
commit 6c54574
Showing
5 changed files
with
59 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
// import Mixnode from "../../src/endpoints/Mixnodes"; | ||
// import { getGatewayIPAddresses } from '../../src/helpers/helper'; | ||
import Mixnode from "../../src/endpoints/Mixnodes"; | ||
import { getMixnodeIPAddresses } from '../../src/helpers/helper'; | ||
|
||
// describe("Get mixnode related info", (): void => { | ||
// let contract: Mixnode; | ||
// let gatewayHosts: string[]; | ||
// beforeAll(async (): Promise<void> => { | ||
// try { | ||
// gatewayHosts = await getGatewayIPAddresses(); | ||
// console.log(gatewayHosts) | ||
// } catch (error) { | ||
// throw new Error(`Error fetching gateway IP addresses: ${error.message}`); | ||
// } | ||
// }); | ||
describe("Get mixnode related info", (): void => { | ||
let contract: Mixnode; | ||
let mixnodeHosts: string[]; | ||
beforeAll(async (): Promise<void> => { | ||
try { | ||
mixnodeHosts = await getMixnodeIPAddresses(); | ||
console.log(mixnodeHosts) | ||
} catch (error) { | ||
throw new Error(`Error fetching mixnode IP addresses: ${error.message}`); | ||
} | ||
}); | ||
|
||
// beforeEach(async (): Promise<void> => { | ||
// for (let i = 0; i < gatewayHosts.length; i++) { | ||
// console.log("currently trying gateway host", gatewayHosts[i]) | ||
// contract = new Mixnode(gatewayHosts[i]); | ||
// } | ||
// }); | ||
beforeEach(async (): Promise<void> => { | ||
// Testing only 3 nodes from the list | ||
for (let i = 3; i < mixnodeHosts.length; i++) { | ||
console.log("currently trying mixnode host", mixnodeHosts[i]) | ||
contract = new Mixnode(mixnodeHosts[i]); | ||
} | ||
}); | ||
|
||
// it("Get mixnode details", async (): Promise<void> => { | ||
// const response = await contract.getMixnodeInfo(); | ||
// // TODO implement checks here | ||
// }); | ||
|
||
// }); | ||
it("Get mixnode details", async (): Promise<void> => { | ||
const response = await contract.getMixnodeInfo(); | ||
// This response is currently just empty {}, amend it when it changes | ||
expect(response).toEqual({}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
// import { Mixnodes } from "../types/MixnodeTypes"; | ||
// import { APIClient } from "./abstracts/APIClient"; | ||
import { Mixnodes } from "../types/MixnodeTypes"; | ||
import { APIClient } from "./abstracts/APIClient"; | ||
|
||
// export default class Mixnode extends APIClient { | ||
// constructor(baseUrl: string) { | ||
// super(baseUrl, "/"); | ||
// } | ||
export default class Mixnode extends APIClient { | ||
constructor(baseUrl: string) { | ||
super(baseUrl, "/"); | ||
} | ||
|
||
// public async getMixnodeInfo(): Promise<Mixnodes> { | ||
// const response = await this.restClient.sendGet({ | ||
// route: `mixnode`, | ||
// }); | ||
// return response; | ||
// } | ||
// } | ||
public async getMixnodeInfo(): Promise<Mixnodes> { | ||
const response = await this.restClient.sendGet({ | ||
route: `mixnode`, | ||
}); | ||
return response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
// export interface Mixnodes {} | ||
export interface Mixnodes {} |