Skip to content

feature: upgrade boilerplate to hyperweb #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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