Skip to content

Commit f094491

Browse files
authored
Merge pull request #20 from cosmology-tech/injective-test
Injective test
2 parents b5ac417 + 81450a6 commit f094491

File tree

4 files changed

+13
-124
lines changed

4 files changed

+13
-124
lines changed

networks/injective/starship/__tests__/gov.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ describe("Governance tests for injective", () => {
4949
denom = getCoin().base;
5050

5151
// Initialize auth
52-
const directAuth = Secp256k1Auth.fromMnemonic(generateMnemonic());
53-
const aminoAuth = Secp256k1Auth.fromMnemonic(generateMnemonic());
52+
const directAuth = Secp256k1Auth.fromMnemonic(generateMnemonic()).derive('injective');
53+
const aminoAuth = Secp256k1Auth.fromMnemonic(generateMnemonic()).derive('injective');
5454
directSigner = new DirectSigner(
5555
directAuth,
5656
toEncoders(MsgDelegate, TextProposal, MsgSubmitProposal, MsgVote),
@@ -81,7 +81,7 @@ describe("Governance tests for injective", () => {
8181
denom,
8282
});
8383

84-
expect(balance!.amount).toEqual("10000000000");
84+
expect(balance!.amount).toEqual("10000000000000000000000");
8585
}, 10000);
8686

8787
it("check amino address has tokens", async () => {
@@ -90,7 +90,7 @@ describe("Governance tests for injective", () => {
9090
denom,
9191
});
9292

93-
expect(balance!.amount).toEqual("10000000000");
93+
expect(balance!.amount).toEqual("10000000000000000000000");
9494
}, 10000);
9595

9696
it("query validator address", async () => {
@@ -153,7 +153,6 @@ describe("Governance tests for injective", () => {
153153
description: "Test text proposal for the e2e testing",
154154
});
155155

156-
// Stake half of the tokens
157156
const msg = {
158157
typeUrl: MsgSubmitProposal.typeUrl,
159158
value: MsgSubmitProposal.fromPartial({

networks/injective/starship/__tests__/staking.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("Staking tokens testing", () => {
3737

3838
const mnemonic = generateMnemonic();
3939
// Initialize auth
40-
const auth = Secp256k1Auth.fromMnemonic(mnemonic);
40+
const auth = Secp256k1Auth.fromMnemonic(mnemonic).derive("injective");
4141
directSigner = new DirectSigner(
4242
auth,
4343
toEncoders(MsgDelegate),
@@ -51,7 +51,7 @@ describe("Staking tokens testing", () => {
5151
// Create custom cosmos interchain client
5252
queryClient = new RpcQuery(getRpcEndpoint());
5353

54-
// Transfer injective and ibc tokens to address, send only osmo to address
54+
// Transfer injective and ibc tokens to address, send only inj to address
5555
await creditFromFaucet(address);
5656
}, 200000);
5757

@@ -61,7 +61,7 @@ describe("Staking tokens testing", () => {
6161
denom,
6262
});
6363

64-
expect(balance!.amount).toEqual("10000000000");
64+
expect(balance!.amount).toEqual("10000000000000000000000");
6565
}, 10000);
6666

6767
it("query validator address", async () => {

networks/injective/starship/__tests__/testnet.test.ts

Lines changed: 0 additions & 110 deletions
This file was deleted.

networks/injective/starship/__tests__/token.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe("Token transfers", () => {
3030

3131
const mnemonic = generateMnemonic();
3232
// Initialize auth
33-
const auth = Secp256k1Auth.fromMnemonic(mnemonic);
33+
const auth = Secp256k1Auth.fromMnemonic(mnemonic).derive("injective");
3434
directSigner = new DirectSigner(auth, [], getRpcEndpoint(), {
3535
prefix: chainInfo.chain.bech32_prefix,
3636
});
@@ -45,7 +45,7 @@ describe("Token transfers", () => {
4545
it("send injective token to address", async () => {
4646
const mnemonic = generateMnemonic();
4747
// Initialize wallet
48-
const auth2 = Secp256k1Auth.fromMnemonic(mnemonic);
48+
const auth2 = Secp256k1Auth.fromMnemonic(mnemonic).derive("injective");
4949
const address2 = defaultSignerOptions.publicKey
5050
.hash(auth2.getPublicKey(defaultSignerOptions.publicKey.isCompressed))
5151
.toBech32(chainInfo.chain.bech32_prefix);
@@ -65,7 +65,7 @@ describe("Token transfers", () => {
6565
denom,
6666
};
6767

68-
// Transfer uosmo tokens from faceut
68+
// Transfer inj tokens from faceut
6969
directSigner.addEncoders(toEncoders(MsgSend));
7070
await directSigner.signAndBroadcast(
7171
[
@@ -85,13 +85,13 @@ describe("Token transfers", () => {
8585
expect(balance!.denom).toEqual(denom);
8686
}, 10000);
8787

88-
it("send ibc osmo tokens to address on cosmos chain", async () => {
88+
it("send ibc inj tokens to address on cosmos chain", async () => {
8989
const {
9090
chainInfo: cosmosChainInfo,
9191
getRpcEndpoint: cosmosRpcEndpoint,
9292
} = useChain("cosmos");
9393

94-
const { getRpcEndpoint: osmosisRpcEndpoint } = useChain("injective");
94+
// const { getRpcEndpoint: injRpcEndpoint } = useChain("injective");
9595

9696
// Initialize wallet address for cosmos chain
9797
const cosmosAuth = Secp256k1Auth.fromMnemonic(generateMnemonic());
@@ -163,7 +163,7 @@ describe("Token transfers", () => {
163163

164164
await new Promise((resolve) => setTimeout(resolve, 6000));
165165

166-
// Check osmos in address on cosmos chain
166+
// Check injs in address on cosmos chain
167167
const cosmosQueryClient = new RpcQuery(cosmosRpcEndpoint());
168168
const { balances } = await cosmosQueryClient.allBalances({
169169
address: cosmosAddress,

0 commit comments

Comments
 (0)