Skip to content

Commit

Permalink
Merge pull request #23 from hyperweb-io/anmol/update-boilerplate
Browse files Browse the repository at this point in the history
feature: upgrade boilerplate to hyperweb
  • Loading branch information
Anmol1696 authored Feb 28, 2025
2 parents f35d1d2 + 6f7d591 commit c50c9ca
Show file tree
Hide file tree
Showing 19 changed files with 8,960 additions and 1,067 deletions.
4 changes: 2 additions & 2 deletions templates/hyperweb/.github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:

- name: Set Up Starship Infrastructure
id: starship-infra
uses: cosmology-tech/[email protected].7
uses: cosmology-tech/[email protected].9
with:
config: configs/ci.yaml
cli-version: 2.10.2
cli-version: 3.3.0

- name: Run E2E Tests
run: yarn test
173 changes: 0 additions & 173 deletions templates/hyperweb/__tests__/ammContract.test.ts

This file was deleted.

51 changes: 13 additions & 38 deletions templates/hyperweb/__tests__/setup.test.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,27 @@
import path from "path";
// @ts-nocheck
import path from 'path';

import { SigningClient } from "@interchainjs/cosmos/signing-client";
import { DirectGenericOfflineSigner } from "@interchainjs/cosmos/types/wallet";
import { Secp256k1HDWallet } from "@interchainjs/cosmos/wallets/secp256k1hd";
import {
ConfigContext,
generateMnemonic,
useChain,
useRegistry,
} from "starshipjs";
import { StargateClient } from '@cosmjs/stargate';

import { ConfigContext, useChain, useRegistry } from 'starshipjs';

beforeAll(async () => {
const configFile = path.join(__dirname, "..", "configs", "local.yaml");
const configFile = path.join(__dirname, '..', 'configs', 'local.yaml');
ConfigContext.setConfigFile(configFile);
ConfigContext.setRegistry(await useRegistry(configFile));
});

describe("Test clients", () => {
let client: SigningClient;
describe('Test clients', () => {
let client;

beforeAll(async () => {
const { getRpcEndpoint, chainInfo } = useChain("hyperweb");

const commonPrefix = chainInfo?.chain?.bech32_prefix;
const cosmosHdPath = "m/44'/118'/0'/0/0";

const directWallet = Secp256k1HDWallet.fromMnemonic(generateMnemonic(), [
{
prefix: commonPrefix,
hdPath: cosmosHdPath,
},
]);
const directSigner = directWallet.toOfflineDirectSigner();

client = await SigningClient.connectWithSigner(
await getRpcEndpoint(),
new DirectGenericOfflineSigner(directSigner),
{
signerOptions: {
prefix: commonPrefix,
},
}
);
const { getRpcEndpoint } = useChain('hyperweb');
client = await StargateClient.connect(await getRpcEndpoint());
});

it("check chain height", async () => {
const { header } = await client.getBlock(1);
it('check chain height', async () => {
const height = await client.getHeight();

expect(header.height).toBeGreaterThan(0);
expect(height).toBeGreaterThan(0);
});
});
Loading

0 comments on commit c50c9ca

Please sign in to comment.