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

feat: upgrade workflows, keplr and client to v2 #129

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
yarn symlink

- name: Test @chain-registry/keplr 🔍
run: cd packages/keplr && yarn test
run: cd v2/keplr && yarn test

- name: Legacy Test @chain-registry/cosmostation 🔍
run: cd legacy/cosmostation && yarn test
Expand Down
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "packages/chain-registry/chain-registry"]
path = packages/chain-registry/chain-registry
[submodule "repos/fixtures"]
path = repos/fixtures
url = https://github.com/chain-registry/fixtures.git
[submodule "repos/chain-registry"]
path = repos/chain-registry
url = https://github.com/cosmos/chain-registry.git
[submodule "packages/chain-registry/chain-registry-fixtures"]
path = packages/chain-registry/chain-registry-fixtures
url = https://github.com/cosmology-tech/chain-registry-fixtures
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ def: update-cosmos update-fixtures

update-cosmos:
@echo "Updating cosmos/chain-registry submodule"
git config submodule.packages/chain-registry/chain-registry.url https://github.com/cosmos/chain-registry
git submodule sync packages/chain-registry/chain-registry
git submodule update --init --remote packages/chain-registry/chain-registry
git config submodule.repos/chain-registry.url https://github.com/cosmos/chain-registry
git submodule sync repos/chain-registry
git submodule update --init --remote repos/chain-registry
@echo "cosmos/chain-registry submodule is updated"

update-fixtures:
@echo "Updating cosmology-tech/chain-registry-fixtures submodule"
git config submodule.packages/chain-registry/chain-registry-fixtures.url https://github.com/cosmology-tech/chain-registry-fixtures
git submodule sync packages/chain-registry/chain-registry-fixtures
git submodule update --init --remote packages/chain-registry/chain-registry-fixtures
@echo "cosmology-tech/chain-registry-fixtures submodule is updated"
@echo "Updating chain-registry/fixtures submodule"
git config submodule.repos/fixtures.url https://github.com/chain-registry/fixtures
git submodule sync repos/fixtures
git submodule update --init --remote repos/fixtures
@echo "chain-registry/fixtures submodule is updated"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ A Client for `chain-registry` that allows you to dynamically fetch data.

Types for `chain-registry`.

#### [@chain-registry/keplr](packages/keplr)
#### [@chain-registry/keplr](legacy/keplr)

Keplr integration for the chain-registry returning keplr's `ChainInfo` type from `@chain-registry/types` `Chain` type.

Expand Down Expand Up @@ -241,7 +241,7 @@ Use the following Makefile commands to update the data in the submodules. These
make update-cosmos
```

- **update-fixtures**: Updates the submodule to the latest commits of the `cosmology-tech/chain-registry-fixtures` repository. Use this for testing purposes to ensure that your tests are running against stable, controlled data sets.
- **update-fixtures**: Updates the submodule to the latest commits of the `chain-registry/fixtures` repository. Use this for testing purposes to ensure that your tests are running against stable, controlled data sets.

```
make update-fixtures
Expand Down
2 changes: 1 addition & 1 deletion __output__/base/assetlist.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export interface Asset {
description?: string;
extended_description?: string;
denom_units: DenomUnit[];
type_asset?: "sdk.coin" | "cw20" | "erc20" | "ics20" | "snip20" | "snip25" | "bitcoin-like" | "evm-base" | "svm-base" | "substrate";
address?: string;
base: string;
name: string;
Expand Down Expand Up @@ -35,6 +34,7 @@ export interface Asset {
website?: string;
twitter?: string;
};
asset_type?: "sdk.coin" | "cw20" | "erc20" | "ics20" | "snip20" | "snip25" | "bitcoin-like" | "evm-base" | "svm-base" | "substrate" | "unknown" | "sdk.factory" | "bitsong";
}
export interface DenomUnit {
denom: string;
Expand Down
2 changes: 1 addition & 1 deletion __output__/camel/assetlist.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export interface Asset {
description?: string;
extendedDescription?: string;
denomUnits: DenomUnit[];
typeAsset?: "sdk.coin" | "cw20" | "erc20" | "ics20" | "snip20" | "snip25" | "bitcoin-like" | "evm-base" | "svm-base" | "substrate";
address?: string;
base: string;
name: string;
Expand Down Expand Up @@ -35,6 +34,7 @@ export interface Asset {
website?: string;
twitter?: string;
};
assetType?: "sdk.coin" | "cw20" | "erc20" | "ics20" | "snip20" | "snip25" | "bitcoin-like" | "evm-base" | "svm-base" | "substrate" | "unknown" | "sdk.factory" | "bitsong";
}
export interface DenomUnit {
denom: string;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/chain-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ A Client for `chain-registry` that allows you to dynamically fetch data.

Types for `chain-registry`.

#### [@chain-registry/keplr](packages/keplr)
#### [@chain-registry/keplr](legacy/keplr)

Keplr integration for the chain-registry returning keplr's `ChainInfo` type from `@chain-registry/types` `Chain` type.

Expand Down
1 change: 0 additions & 1 deletion packages/chain-registry/chain-registry-fixtures
Submodule chain-registry-fixtures deleted from 461207
1 change: 1 addition & 0 deletions repos/fixtures
Submodule fixtures added at 118197
2 changes: 1 addition & 1 deletion v2/chain-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ A Client for `chain-registry` that allows you to dynamically fetch data.

Types for `chain-registry`.

#### [@chain-registry/keplr](packages/keplr)
#### [@chain-registry/keplr](legacy/keplr)

Keplr integration for the chain-registry returning keplr's `ChainInfo` type from `@chain-registry/types` `Chain` type.

Expand Down
2 changes: 1 addition & 1 deletion v2/chain-registry/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as path from 'path';
import { jsStringify } from 'strfy-js';

const NON_COSMOS_NETWORK_TYPE = 'noncosmos';
const registryDir = path.resolve(`${__dirname}/../../../packages/chain-registry/chain-registry`);
const registryDir = path.resolve(`${__dirname}/../../../repos/chain-registry`);
const registryDirInRepoPath = 'chain-registry/chain-registry';
const chainRegTypesModule = '@chain-registry/v2-types';

Expand Down
2 changes: 1 addition & 1 deletion v2/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ await registry.fetchUrls();

#### Fetching Schemata

We currently only support fetching JSON schemas as defined in https://github.com/cosmos/chain-registry. Supported are `assetlist.schema.json`, `chain.schema.json` and `ibc_data.schema.json`.
We currently only support fetching JSON schemas as defined in https://github.com/chain-registry/chain-registry/tree/main/registries/minimal. Supported are `assetlist.schema.json`, `chain.schema.json` and `ibc_data.schema.json`.

#### fetchUrls

Expand Down
12 changes: 6 additions & 6 deletions v2/client/__tests__/fetcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ describe('Test fetcher', () => {
beforeAll(async () => {
const options: ChainRegistryFetcherOptions = {
urls: [
'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/chain.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/assetlist.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/assetlist.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/secretnetwork/assetlist.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/juno-osmosis.json',
'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/osmosis-secretnetwork.json'
'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/osmosis/chain.json',
'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/osmosis/assetlist.json',
'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/juno/assetlist.json',
'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/secretnetwork/assetlist.json',
'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/_IBC/juno-osmosis.json',
'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/_IBC/osmosis-secretnetwork.json'
]
};

Expand Down
32 changes: 16 additions & 16 deletions v2/client/setup-jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,42 @@ const baseUrl = 'https://raw.githubusercontent.com';


beforeAll(() => {
// 'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/chain.json',
// 'https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/assetlist.json',
// 'https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/assetlist.json',
// 'https://raw.githubusercontent.com/cosmos/chain-registry/master/secretnetwork/assetlist.json',
// 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/juno-osmosis.json',
// 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_IBC/osmosis-secretnetwork.json'
nock(baseUrl)
.get('/cosmos/chain-registry/master/osmosis/chain.json')
// 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/osmosis/chain.json',
// 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/osmosis/assetlist.json',
// 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/juno/assetlist.json',
// 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/secretnetwork/assetlist.json',
// 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/_IBC/juno-osmosis.json',
// 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal/_IBC/osmosis-secretnetwork.json'
nock(baseUrl)
.get('/chain-registry/chain-registry/main/registries/minimal/osmosis/chain.json')
.reply(200, chains.find(c => c.chain_name === 'osmosis'));
nock(baseUrl)
.get('/cosmos/chain-registry/master/osmosis/assetlist.json')
.get('/chain-registry/chain-registry/main/registries/minimal/osmosis/assetlist.json')
.reply(200, assets.find(c => c.chain_name === 'osmosis'));

nock(baseUrl)
.get('/cosmos/chain-registry/master/stargaze/chain.json')
.get('/chain-registry/chain-registry/main/registries/minimal/stargaze/chain.json')
.reply(200, chains.find(c => c.chain_name === 'stargaze'));
nock(baseUrl)
.get('/cosmos/chain-registry/master/stargaze/assetlist.json')
.get('/chain-registry/chain-registry/main/registries/minimal/stargaze/assetlist.json')
.reply(200, assets.find(c => c.chain_name === 'stargaze'));

nock(baseUrl)
.get('/cosmos/chain-registry/master/juno/chain.json')
.get('/chain-registry/chain-registry/main/registries/minimal/juno/chain.json')
.reply(200, chains.find(c => c.chain_name === 'juno'));
nock(baseUrl)
.get('/cosmos/chain-registry/master/juno/assetlist.json')
.get('/chain-registry/chain-registry/main/registries/minimal/juno/assetlist.json')
.reply(200, assets.find(c => c.chain_name === 'juno'));

nock(baseUrl)
.get('/cosmos/chain-registry/master/secretnetwork/assetlist.json')
.get('/chain-registry/chain-registry/main/registries/minimal/secretnetwork/assetlist.json')
.reply(200, assets.find(c => c.chain_name === 'secretnetwork'));

nock(baseUrl)
.get('/cosmos/chain-registry/master/_IBC/juno-osmosis.json')
.get('/chain-registry/chain-registry/main/registries/minimal/_IBC/juno-osmosis.json')
.reply(200, ibc.find(i => i.chain_1.chain_name === 'juno' && i.chain_2.chain_name==='osmosis'));
nock(baseUrl)
.get('/cosmos/chain-registry/master/_IBC/osmosis-secretnetwork.json')
.get('/chain-registry/chain-registry/main/registries/minimal/_IBC/osmosis-secretnetwork.json')
.reply(200, ibc.find(i => i.chain_1.chain_name === 'osmosis' && i.chain_2.chain_name==='secretnetwork'));
});

Expand Down
2 changes: 1 addition & 1 deletion v2/client/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface ChainRegistryClientOptions
export class ChainRegistryClient extends ChainRegistryFetcher {
protected _options: ChainRegistryClientOptions = {
chainNames: [],
baseUrl: 'https://raw.githubusercontent.com/cosmos/chain-registry/master'
baseUrl: 'https://raw.githubusercontent.com/chain-registry/chain-registry/main/registries/minimal'
};

constructor(options: ChainRegistryClientOptions) {
Expand Down
Loading
Loading