Skip to content

Commit c50c9ca

Browse files
authored
Merge pull request #23 from hyperweb-io/anmol/update-boilerplate
feature: upgrade boilerplate to hyperweb
2 parents f35d1d2 + 6f7d591 commit c50c9ca

File tree

19 files changed

+8960
-1067
lines changed

19 files changed

+8960
-1067
lines changed

templates/hyperweb/.github/workflows/e2e-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131

3232
- name: Set Up Starship Infrastructure
3333
id: starship-infra
34-
uses: cosmology-tech/[email protected].7
34+
uses: cosmology-tech/[email protected].9
3535
with:
3636
config: configs/ci.yaml
37-
cli-version: 2.10.2
37+
cli-version: 3.3.0
3838

3939
- name: Run E2E Tests
4040
run: yarn test

templates/hyperweb/__tests__/ammContract.test.ts

-173
This file was deleted.
+13-38
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,27 @@
1-
import path from "path";
1+
// @ts-nocheck
2+
import path from 'path';
23

3-
import { SigningClient } from "@interchainjs/cosmos/signing-client";
4-
import { DirectGenericOfflineSigner } from "@interchainjs/cosmos/types/wallet";
5-
import { Secp256k1HDWallet } from "@interchainjs/cosmos/wallets/secp256k1hd";
6-
import {
7-
ConfigContext,
8-
generateMnemonic,
9-
useChain,
10-
useRegistry,
11-
} from "starshipjs";
4+
import { StargateClient } from '@cosmjs/stargate';
5+
6+
import { ConfigContext, useChain, useRegistry } from 'starshipjs';
127

138
beforeAll(async () => {
14-
const configFile = path.join(__dirname, "..", "configs", "local.yaml");
9+
const configFile = path.join(__dirname, '..', 'configs', 'local.yaml');
1510
ConfigContext.setConfigFile(configFile);
1611
ConfigContext.setRegistry(await useRegistry(configFile));
1712
});
1813

19-
describe("Test clients", () => {
20-
let client: SigningClient;
14+
describe('Test clients', () => {
15+
let client;
2116

2217
beforeAll(async () => {
23-
const { getRpcEndpoint, chainInfo } = useChain("hyperweb");
24-
25-
const commonPrefix = chainInfo?.chain?.bech32_prefix;
26-
const cosmosHdPath = "m/44'/118'/0'/0/0";
27-
28-
const directWallet = Secp256k1HDWallet.fromMnemonic(generateMnemonic(), [
29-
{
30-
prefix: commonPrefix,
31-
hdPath: cosmosHdPath,
32-
},
33-
]);
34-
const directSigner = directWallet.toOfflineDirectSigner();
35-
36-
client = await SigningClient.connectWithSigner(
37-
await getRpcEndpoint(),
38-
new DirectGenericOfflineSigner(directSigner),
39-
{
40-
signerOptions: {
41-
prefix: commonPrefix,
42-
},
43-
}
44-
);
18+
const { getRpcEndpoint } = useChain('hyperweb');
19+
client = await StargateClient.connect(await getRpcEndpoint());
4520
});
4621

47-
it("check chain height", async () => {
48-
const { header } = await client.getBlock(1);
22+
it('check chain height', async () => {
23+
const height = await client.getHeight();
4924

50-
expect(header.height).toBeGreaterThan(0);
25+
expect(height).toBeGreaterThan(0);
5126
});
5227
});

0 commit comments

Comments
 (0)