Skip to content
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

fix: devnet #270

Merged
merged 8 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 7 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
23 changes: 15 additions & 8 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"": {
"name": "@liftedinit/manifest-app",
"dependencies": {
"@chain-registry/assets": "^1.70.120",
"@chain-registry/assets": "^1.70.122",
"@cosmjs/cosmwasm-stargate": "0.32.4",
"@cosmjs/stargate": "npm:@liftedinit/[email protected]",
"@cosmos-kit/cosmos-extension-metamask": "^0.12.3",
Expand All @@ -18,15 +18,16 @@
"@liftedinit/manifestjs": "0.0.1-rc.1",
"@react-three/drei": "^9.114.0",
"@react-three/fiber": "^8.17.8",
"@skip-go/client": "^0.16.8",
"@skip-go/client": "^0.16.9",
"@tanstack/react-query": "^5.55.0",
"@tanstack/react-query-devtools": "^5.55.0",
"@types/file-saver": "^2.0.7",
"@types/react-syntax-highlighter": "^15.5.13",
"apexcharts": "^3.54.0",
"autoprefixer": "^10.4.20",
"babel-plugin-glsl": "^1.0.0",
"chain-registry": "^1.69.120",
"bech32": "^2.0.0",
"chain-registry": "^1.69.122",
"cosmjs-types": "^0.9.0",
"cosmos-kit": "2.23.9",
"country-flag-icons": "^1.5.13",
Expand Down Expand Up @@ -109,7 +110,7 @@

"@babel/runtime": ["@babel/[email protected]", "", { "dependencies": { "regenerator-runtime": "^0.14.0" } }, "sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ=="],

"@chain-registry/assets": ["@chain-registry/[email protected].120", "", { "dependencies": { "@chain-registry/types": "^0.50.69" } }, "sha512-xM6LJCzLXfr7ODMbZwEbIKDKtZS6XlripAR/ihQ0Zh8iHgG0qQ9kKbKZR7MExQLP6zb7eUAy5orBxFdiZJP0mQ=="],
"@chain-registry/assets": ["@chain-registry/[email protected].122", "", { "dependencies": { "@chain-registry/types": "^0.50.71" } }, "sha512-arCuDQR0M0+CMvWWKb9oaeNMRHeXnI7YTPjCkDXcjW7qzljtn3pmsLei1AahEv720SJxo8uVhuTwwK/rYhCl0w=="],

"@chain-registry/client": ["@chain-registry/[email protected]", "", { "dependencies": { "@chain-registry/types": "^0.50.64", "@chain-registry/utils": "^1.51.64", "bfs-path": "^1.0.2", "cross-fetch": "^3.1.5" } }, "sha512-NxQFOCT/SUbU5elvoQ4k7GNpMiRbFN5waQ7Fb6+MyDF4dUWMrFwcn+fLrs1JDHakip1SNVMOfKbBERlrW4D5qw=="],

Expand Down Expand Up @@ -1189,7 +1190,7 @@

"base64url": ["[email protected]", "", {}, "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A=="],

"bech32": ["bech32@1.1.4", "", {}, "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="],
"bech32": ["bech32@2.0.0", "", {}, "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg=="],

"before-after-hook": ["[email protected]", "", {}, "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A=="],

Expand Down Expand Up @@ -1267,7 +1268,7 @@

"cardinal": ["[email protected]", "", { "dependencies": { "ansicolors": "~0.3.2", "redeyed": "~2.1.0" }, "bin": { "cdl": "./bin/cdl.js" } }, "sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw=="],

"chain-registry": ["[email protected].120", "", { "dependencies": { "@chain-registry/types": "^0.50.69" } }, "sha512-4+0YgaDAVkzeZkJp3BZm8H7g2O1Me/+Sv6nT+ene6amKxtyRxKx+h45SiCblBxBtE44z2hSrti5/F/tPzK4+LA=="],
"chain-registry": ["[email protected].122", "", { "dependencies": { "@chain-registry/types": "^0.50.71" } }, "sha512-poh8f3t2MCIKs3oClqi472O4ZFUaujz62OjPcId0uyHoJC30UiwkKBiCGt389cB+9Ip/kEvN8sSQ539dwhNhfw=="],

"chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg=="],

Expand Down Expand Up @@ -2667,6 +2668,8 @@

"@choojs/findup/commander": ["[email protected]", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="],

"@cosmjs/encoding/bech32": ["[email protected]", "", {}, "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="],

"@cosmjs/socket/ws": ["[email protected]", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ=="],

"@cosmos-kit/core/uuid": ["[email protected]", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="],
Expand All @@ -2689,6 +2692,8 @@

"@ethersproject/json-wallets/aes-js": ["[email protected]", "", {}, "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw=="],

"@ethersproject/providers/bech32": ["[email protected]", "", {}, "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="],

"@ethersproject/providers/ws": ["[email protected]", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A=="],

"@ethersproject/signing-key/elliptic": ["[email protected]", "", { "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.1", "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" } }, "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ=="],
Expand All @@ -2707,8 +2712,6 @@

"@injectivelabs/sdk-ts/axios": ["[email protected]", "", { "dependencies": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" } }, "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ=="],

"@injectivelabs/sdk-ts/bech32": ["[email protected]", "", {}, "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg=="],

"@injectivelabs/sdk-ts/cosmjs-types": ["[email protected]", "", { "dependencies": { "long": "^4.0.0", "protobufjs": "~6.11.2" } }, "sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA=="],

"@injectivelabs/sdk-ts/ethers": ["[email protected]", "", { "dependencies": { "@ethersproject/abi": "5.7.0", "@ethersproject/abstract-provider": "5.7.0", "@ethersproject/abstract-signer": "5.7.0", "@ethersproject/address": "5.7.0", "@ethersproject/base64": "5.7.0", "@ethersproject/basex": "5.7.0", "@ethersproject/bignumber": "5.7.0", "@ethersproject/bytes": "5.7.0", "@ethersproject/constants": "5.7.0", "@ethersproject/contracts": "5.7.0", "@ethersproject/hash": "5.7.0", "@ethersproject/hdnode": "5.7.0", "@ethersproject/json-wallets": "5.7.0", "@ethersproject/keccak256": "5.7.0", "@ethersproject/logger": "5.7.0", "@ethersproject/networks": "5.7.1", "@ethersproject/pbkdf2": "5.7.0", "@ethersproject/properties": "5.7.0", "@ethersproject/providers": "5.7.2", "@ethersproject/random": "5.7.0", "@ethersproject/rlp": "5.7.0", "@ethersproject/sha2": "5.7.0", "@ethersproject/signing-key": "5.7.0", "@ethersproject/solidity": "5.7.0", "@ethersproject/strings": "5.7.0", "@ethersproject/transactions": "5.7.0", "@ethersproject/units": "5.7.0", "@ethersproject/wallet": "5.7.0", "@ethersproject/web": "5.7.1", "@ethersproject/wordlists": "5.7.0" } }, "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg=="],
Expand Down Expand Up @@ -2737,6 +2740,8 @@

"@keplr-wallet/cosmos/@keplr-wallet/unit": ["@keplr-wallet/[email protected]", "", { "dependencies": { "@keplr-wallet/types": "0.12.28", "big-integer": "^1.6.48", "utility-types": "^3.10.0" } }, "sha512-kpXigHDBJGOmhtPkv9hqsQid9zkFo7OQPeKgO2n8GUlOINIXW6kWG5LXYTi/Yg9Uiw1CQF69gFMuZCJ8IzVHlA=="],

"@keplr-wallet/cosmos/bech32": ["[email protected]", "", {}, "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="],

"@keplr-wallet/provider/@keplr-wallet/types": ["@keplr-wallet/[email protected]", "", { "dependencies": { "long": "^4.0.0" }, "peerDependencies": { "starknet": "^6" } }, "sha512-UsIR/ix39hH/yygj0ZrdOsMqOGCq43NzkU8famtwQFQjB+jkKKADPq6SmhJjSrVr8PqPtWfIfUxa3jaAmsAUJQ=="],

"@keplr-wallet/provider/deepmerge": ["[email protected]", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="],
Expand Down Expand Up @@ -3309,6 +3314,8 @@

"yargs/find-up/locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="],

"@cosmsnap/snapper/@cosmjs/amino/@cosmjs/encoding/bech32": ["[email protected]", "", {}, "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="],

"@injectivelabs/sdk-ts/@cosmjs/amino/@cosmjs/encoding/bech32": ["[email protected]", "", {}, "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="],

"@injectivelabs/sdk-ts/@cosmjs/proto-signing/@cosmjs/encoding/bech32": ["[email protected]", "", {}, "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="],
Expand Down
36 changes: 36 additions & 0 deletions config/manifestChain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import env from './env';
import { AssetList, Chain, IBCInfo } from '@chain-registry/types';

const buildType = env.chainTier;
let manifestModule: {
assets: AssetList;
chain: Chain;
ibc?: IBCInfo[];
};

// TODO: Add mainnet manifest when it's available
if (!buildType) {
throw new Error('Chain tier environment variable is not set');

Check warning on line 13 in config/manifestChain.ts

View check run for this annotation

Codecov / codecov/patch

config/manifestChain.ts#L13

Added line #L13 was not covered by tests
}

if (buildType === 'qa') {
manifestModule = require('chain-registry/devnet/manifestdevnet');

Check warning on line 17 in config/manifestChain.ts

View check run for this annotation

Codecov / codecov/patch

config/manifestChain.ts#L17

Added line #L17 was not covered by tests
} else {
manifestModule = require('chain-registry/testnet/manifesttestnet');
}

let manifestAssets: AssetList, manifestChain: Chain, manifestIbc: IBCInfo[];

if (buildType === 'qa') {
const { assets, chain } = manifestModule;
manifestAssets = assets;
manifestChain = chain;
manifestIbc = []; // Default value since devnet doesn't include ibc

Check warning on line 28 in config/manifestChain.ts

View check run for this annotation

Codecov / codecov/patch

config/manifestChain.ts#L25-L28

Added lines #L25 - L28 were not covered by tests
} else {
const { assets, chain, ibc } = manifestModule;
manifestAssets = assets;
manifestChain = chain;
manifestIbc = ibc!;
}
Comment on lines +21 to +31
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Add test coverage for manifest initialization.

The manifest initialization logic lacks test coverage, which is crucial for ensuring correct behavior across different build types.


🏁 Script executed:

#!/bin/bash
# Description: Check test coverage for manifest initialization

# Find test files related to manifest configuration
fd -e test.ts -e spec.ts -e test.tsx -e spec.tsx . | grep -i manifest

# Check if there are any tests importing manifestChain
rg -l "from ['\"]\@\/config\/manifestChain['\"]" -g '*.test.{ts,tsx}' -g '*.spec.{ts,tsx}'

Length of output: 282


I'm going to re-run the test search with an updated command that avoids regex escape issues. We'll use rg -F for fixed-string matching. Please run the following script:

Once we have the output, we can determine whether tests exist for the manifest initialization logic or if additional coverage needs to be added.


🏁 Script executed:

#!/bin/bash
echo "Searching for tests that import manifestChain..."
rg -l -F "@/config/manifestChain" -g "*.test.ts" -g "*.spec.ts" -g "*.test.tsx" -g "*.spec.tsx" .

Length of output: 204


Manifest Initialization Test Coverage Missing

Our investigation confirms that no tests are importing or referencing @/config/manifestChain. This indicates that the manifest initialization logic (i.e., setting of manifestAssets, manifestChain, and manifestIbc for different build types) currently lacks test coverage.

  • File: config/manifestChain.ts
  • Issue: No tests found covering manifest initialization logic

Please add tests that simulate different buildType values (e.g., 'qa' and others) to validate that assets, chain, and ibc are correctly initialized based on the manifest module.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 25-28: config/manifestChain.ts#L25-L28
Added lines #L25 - L28 were not covered by tests


export { manifestAssets, manifestChain, manifestIbc };
2 changes: 1 addition & 1 deletion hooks/useFeeEstimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

const fee = calculateFee(
Math.round(gasEstimation * (modifier || 1.5)),
GasPrice.fromString(`${gasPrice}${chainName === 'manifesttestnet' ? 'umfx' : 'uosmo'}`)
GasPrice.fromString(`${gasPrice}umfx`)

Check warning on line 28 in hooks/useFeeEstimation.ts

View check run for this annotation

Codecov / codecov/patch

hooks/useFeeEstimation.ts#L28

Added line #L28 was not covered by tests
);

return fee;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@octokit/webhooks": "13.4.3"
},
"dependencies": {
"@chain-registry/assets": "^1.70.120",
"@chain-registry/assets": "^1.70.122",
"@cosmjs/cosmwasm-stargate": "0.32.4",
"@cosmjs/stargate": "npm:@liftedinit/[email protected]",
"@cosmos-kit/cosmos-extension-metamask": "^0.12.3",
Expand All @@ -55,7 +55,8 @@
"apexcharts": "^3.54.0",
"autoprefixer": "^10.4.20",
"babel-plugin-glsl": "^1.0.0",
"chain-registry": "^1.69.120",
"bech32": "^2.0.0",
"chain-registry": "^1.69.122",
"cosmjs-types": "^0.9.0",
"cosmos-kit": "2.23.9",
"country-flag-icons": "^1.5.13",
Expand Down
5 changes: 1 addition & 4 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import { createPortal } from 'react-dom';
import { makeWeb3AuthWallets, SignData } from '@cosmos-kit/web3auth';
import { useEffect, useMemo, useState } from 'react';
import SignModal from '@/components/react/authSignerModal';
import {
assets as manifestAssets,
chain as manifestChain,
} from 'chain-registry/testnet/manifesttestnet';
import {
assets as osmosisAssets,
chain as osmosisChain,
Expand Down Expand Up @@ -46,6 +42,7 @@ import MobileNav from '@/components/react/mobileNav';
import { WEB3AUTH_NETWORK_TYPE } from '@web3auth/auth';

import { SkipProvider } from '@/contexts/skipGoContext';
import { manifestAssets, manifestChain } from '@/config/manifestChain';

type ManifestAppProps = AppProps & {
Component: AppProps['Component'];
Expand Down
5 changes: 1 addition & 4 deletions tests/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ import { render } from '@testing-library/react';
import { ChainProvider } from '@cosmos-kit/react';
import { ToastProvider } from '@/contexts';

import {
assets as manifestAssets,
chain as manifestChain,
} from 'chain-registry/testnet/manifesttestnet';
import {
assets as osmosisAssets,
chain as osmosisChain,
} from 'chain-registry/testnet/osmosistestnet';
import { assets as axelarAssets, chain as axelarChain } from 'chain-registry/testnet/axelartestnet';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { SkipProvider } from '@/contexts/skipGoContext';
import { manifestAssets, manifestChain } from '@/config/manifestChain';

const defaultOptions = {
chains: [manifestChain, osmosisChain, axelarChain],
Expand Down
5 changes: 1 addition & 4 deletions utils/ibc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ import { Asset, AssetList, IBCInfo } from '@chain-registry/types';
import { Coin } from '@liftedinit/manifestjs/dist/codegen/cosmos/base/v1beta1/coin';

import { shiftDigits } from './maths';
import {
assets as manifestAssets,
ibc as manifestIbc,
} from 'chain-registry/testnet/manifesttestnet';
import { assets as osmosisAssets, ibc as osmosisIbc } from 'chain-registry/testnet/osmosistestnet';
import { assets as axelarAssets, ibc as axelarIbc } from 'chain-registry/testnet/axelartestnet';
import { manifestAssets, manifestIbc } from '@/config/manifestChain';

const assets: AssetList[] = [manifestAssets, osmosisAssets, axelarAssets];

Expand Down
3 changes: 2 additions & 1 deletion utils/staking.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Coin, decodeCosmosSdkDecFromProto } from '@cosmjs/stargate';
import * as bech32 from 'bech32';
import { bech32 } from 'bech32';
import BigNumber from 'bignumber.js';
import * as CryptoJS from 'crypto-js';
import { QueryDelegationTotalRewardsResponse } from '@liftedinit/manifestjs/dist/codegen/cosmos/distribution/v1beta1/query';
Expand Down Expand Up @@ -180,6 +180,7 @@ export const parseAnnualProvisions = (data: QueryAnnualProvisionsResponse) => {
const res = shiftDigits(decodeUint8Arr(data?.annualProvisions), -18);
return isGreaterThanZero(res) ? res : null;
};

function wordArrayToUint8Array(wordArray: CryptoJS.lib.WordArray) {
const words = wordArray.words;
const sigBytes = wordArray.sigBytes;
Expand Down
Loading