-
Notifications
You must be signed in to change notification settings - Fork 42
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
Showing
10 changed files
with
100 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
import fs from "fs"; | ||
import { setLogger } from "@axelar-network/axelar-local-dev"; | ||
import { start, startAll } from "../src/docker"; | ||
|
||
setLogger(() => undefined); | ||
import { stopAll, startAll } from "../src/docker"; | ||
|
||
export default async () => { | ||
const config = await start("wasm").catch((e) => console.log(e)); | ||
await new Promise((resolve) => setTimeout(resolve, 5000)); | ||
// fs.writeFileSync("./config.json", JSON.stringify(config)); | ||
await startAll(); | ||
// await new Promise((resolve) => setTimeout(resolve, 3000)); | ||
}; |
42 changes: 21 additions & 21 deletions
42
packages/axelar-local-dev-cosmos/src/__tests__/docker.spec.ts
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,32 +1,32 @@ | ||
import { setLogger } from "@axelar-network/axelar-local-dev"; | ||
import { getOwnerAccount, start, stop } from "../docker"; | ||
import { CosmosClient } from "../CosmosClient"; | ||
import { getOwnerAccount } from "../docker"; | ||
import { CosmosClient } from "../"; | ||
import fetch from "node-fetch"; | ||
|
||
setLogger(() => undefined); | ||
|
||
describe("docker", () => { | ||
it("should start Cosmos container successfully", async () => { | ||
const response = await fetch("http://localhost:26657/health"); | ||
expect(response.status).toBe(200); | ||
}); | ||
it("should start containers successfully", async () => { | ||
const testLcd = "cosmos/base/tendermint/v1beta1/node_info"; | ||
const healthAxelarRpc = await fetch("http://localhost/axelar-rpc"); | ||
const healthAxelarLcd = await fetch( | ||
`http://localhost/axelar-lcd/${testLcd}` | ||
); | ||
const healthWasmRpc = await fetch("http://localhost/wasm-rpc"); | ||
const healthWasmLcd = await fetch(`http://localhost/wasm-lcd/${testLcd}`); | ||
|
||
// it('should start Cosmos container with default denom "udemo"', async () => { | ||
// const owner = await getOwnerAccount(); | ||
// const cosmosClient = await CosmosClient.create({ | ||
// owner, | ||
// }); | ||
expect(healthAxelarRpc.status).toBe(200); | ||
expect(healthAxelarLcd.status).toBe(200); | ||
expect(healthWasmRpc.status).toBe(200); | ||
expect(healthWasmLcd.status).toBe(200); | ||
}); | ||
|
||
// const balance = await cosmosClient.getBalance(owner.address); | ||
it("should have some balance in the owner account", async () => { | ||
const owner = await getOwnerAccount("wasm"); | ||
const cosmosClient = await CosmosClient.create(); | ||
|
||
// expect(parseInt(balance)).toBeGreaterThan(1); | ||
// expect(cosmosClient.getChainInfo().denom).toBe(defaultDenom); | ||
// }); | ||
const balance = await cosmosClient.getBalance(owner.address); | ||
|
||
// it.skip("should stop Cosmos container gracefully", async () => { | ||
// await stop(); | ||
// await fetch("http://localhost:1317/").catch((e) => { | ||
// expect(e.message).toContain("ECONNREFUSED"); | ||
// }); | ||
// }); | ||
expect(parseInt(balance)).toBeGreaterThan(1); | ||
}); | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./CosmosClient"; |
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
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 * from "./CosmosClient"; | ||
export * from "./clients"; |
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