Skip to content

Commit

Permalink
fix: rename statemint/statemine/westmint to asset-hub-polkadot/kusama…
Browse files Browse the repository at this point in the history
…/westend (#1296)

* fix: renamed statemint-mine to asset-hub-*

* yarn lint
  • Loading branch information
Imod7 committed Jun 20, 2023
1 parent 2579500 commit 362e912
Show file tree
Hide file tree
Showing 54 changed files with 97 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import accountsApprovals993480 from './993480.json';

export const statemineAccountsApprovalsEndpoints = [
export const assetHubKusamaAccountsApprovalsEndpoints = [
[
'/accounts/CwqsPsimisa33niBsKd513TBne4PnTHvfhyLR6Vh73DBQMY/asset-approvals?assetId=100&delegate=CwqsPsimisa33niBsKd513TBne4PnTHvfhyLR6Vh73DBQMY&at=993480',
JSON.stringify(accountsApprovals993480),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import accountAssetBalance1100000 from './1100000.json';
import accountAssetBalance1300000 from './1300000.json';
import accountAssetBalance1800000 from './1800000.json';

export const statemineAccountAssetBalanceEndpoints = [
export const assetHubKusamaAccountAssetBalanceEndpoints = [
[
'/accounts/H4DU1hKQeLkR5bhMeMidarF9bVvrH3k6ybLz84YLs7eRQMu/asset-balances?at=450000',
JSON.stringify(accountAssetBalance450000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import accountBalance1100000 from './1100000.json';
import accountBalance1300000 from './1300000.json';
import accountBalance1800000 from './1800000.json';

export const statemineAccountBalanceEndpoints = [
export const assetHubKusamaAccountBalanceEndpoints = [
[
'/accounts/H4DU1hKQeLkR5bhMeMidarF9bVvrH3k6ybLz84YLs7eRQMu/balance-info?at=450000',
JSON.stringify(accountBalance450000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { statemineAccountsApprovalsEndpoints } from './asset-approvals';
import { statemineAccountAssetBalanceEndpoints } from './asset-balances';
import { statemineAccountBalanceEndpoints } from './balance-info';
import { assetHubKusamaAccountsApprovalsEndpoints } from './asset-approvals';
import { assetHubKusamaAccountAssetBalanceEndpoints } from './asset-balances';
import { assetHubKusamaAccountBalanceEndpoints } from './balance-info';

export const statemineAccountAssetEndpoints = [
...statemineAccountBalanceEndpoints,
...statemineAccountAssetBalanceEndpoints,
...statemineAccountsApprovalsEndpoints,
export const assetHubKusamaAccountAssetEndpoints = [
...assetHubKusamaAccountBalanceEndpoints,
...assetHubKusamaAccountAssetBalanceEndpoints,
...assetHubKusamaAccountsApprovalsEndpoints,
];
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import block1100000 from './1100000.json';
import block1300000 from './1300000.json';
import block1800000 from './1800000.json';

export const statemineBlockEndpoints = [
export const assetHubKusamaBlockEndpoints = [
['/blocks/450000', JSON.stringify(block450000)], // v2
['/blocks/650000', JSON.stringify(block650000)], // v3
['/blocks/960000', JSON.stringify(block960000)], // v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { statemineAccountAssetEndpoints } from './accounts';
import { statemineBlockEndpoints } from './blocks';
import { statemineRuntimeEndpoints } from './runtime';
import { assetHubKusamaAccountAssetEndpoints } from './accounts';
import { assetHubKusamaBlockEndpoints } from './blocks';
import { assetHubKusamaRuntimeEndpoints } from './runtime';

export const statemineEndpoints = {
accounts: statemineAccountAssetEndpoints,
blocks: statemineBlockEndpoints,
export const assetHubKusamaEndpoints = {
accounts: assetHubKusamaAccountAssetEndpoints,
blocks: assetHubKusamaBlockEndpoints,
paras: [],
runtime: statemineRuntimeEndpoints,
runtime: assetHubKusamaRuntimeEndpoints,
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

import runtimeSpec993450 from './993450.json';

export const statemineRuntimeEndpoints = [
export const assetHubKusamaRuntimeEndpoints = [
['/runtime/spec?at=993540', JSON.stringify(runtimeSpec993450)],
];
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

/**
* Currently there are no assets established within statemint
* Currently there are no assets established within Asset Hub Polkadot
* so these tests will be empty.
*/
export const statemintAccountAssetBalanceEndpoints = [];
export const assetHubPolkadotAccountsApprovalsEndpoints = [];
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

/**
* Currently there are no assets established within statemint
* Currently there are no assets established within Asset Hub Polkadot
* so these tests will be empty.
*/
export const statemintAccountsApprovalsEndpoints = [];
export const assetHubPolkadotAccountAssetBalanceEndpoints = [];
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { statemintAccountsApprovalsEndpoints } from './asset-approvals';
import { statemintAccountAssetBalanceEndpoints } from './asset-balances';
import { assetHubPolkadotAccountsApprovalsEndpoints } from './asset-approvals';
import { assetHubPolkadotAccountAssetBalanceEndpoints } from './asset-balances';

export const statemintAccountAssetEndpoints = [
...statemintAccountAssetBalanceEndpoints,
...statemintAccountsApprovalsEndpoints,
export const assetHubPolkadotAccountAssetEndpoints = [
...assetHubPolkadotAccountAssetBalanceEndpoints,
...assetHubPolkadotAccountsApprovalsEndpoints,
];
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import block10000 from './10000.json';
import block340000 from './340000.json';

export const statemintBlockEndpoints = [
export const assetHubPolkadotBlockEndpoints = [
['/blocks/10000', JSON.stringify(block10000)], // v2
['/blocks/340000', JSON.stringify(block340000)], // v601
];
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { statemintBlockEndpoints } from './blocks';
import { statemineRuntimeEndpoints } from './runtime';
import { assetHubPolkadotBlockEndpoints } from './blocks';
import { assetHubKusamaRuntimeEndpoints } from './runtime';

export const statemintEndpoints = {
export const assetHubPolkadotEndpoints = {
accounts: [],
blocks: statemintBlockEndpoints,
blocks: assetHubPolkadotBlockEndpoints,
paras: [],
runtime: statemineRuntimeEndpoints,
runtime: assetHubKusamaRuntimeEndpoints,
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

import runtimeSpec340000 from './340000.json';

export const statemineRuntimeEndpoints = [
export const assetHubKusamaRuntimeEndpoints = [
['/runtime/spec?at=340000', JSON.stringify(runtimeSpec340000)],
];
8 changes: 4 additions & 4 deletions e2e-tests/historical/endpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { IChains } from '../types';
import { assetHubKusamaEndpoints } from './asset-hub-kusama';
import { assetHubPolkadotEndpoints } from './asset-hub-polkadot';
import { kusamaEndpoints } from './kusama';
import { polkadotEndpoints } from './polkadot';
import { statemineEndpoints } from './statemine';
import { statemintEndpoints } from './statemint';
import { westendEndpoints } from './westend';

export const endpoints: IChains = {
kusama: kusamaEndpoints,
polkadot: polkadotEndpoints,
westend: westendEndpoints,
statemine: statemineEndpoints,
statemint: statemintEndpoints,
'asset-hub-kusama': assetHubKusamaEndpoints,
'asset-hub-polkadot': assetHubPolkadotEndpoints,
};
8 changes: 7 additions & 1 deletion e2e-tests/historical/historical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ const argv = process.argv.slice(0, 2);
const parser = new ArgumentParser();

parser.add_argument('--chain', {
choices: ['polkadot', 'kusama', 'westend', 'statemine', 'statemint'],
choices: [
'polkadot',
'kusama',
'westend',
'asset-hub-kusama',
'asset-hub-polkadot',
],
default: 'polkadot',
});
parser.add_argument('--config', { default: './e2e-tests/jest.config.js' });
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/historical/types/chainSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* String literal for specific chains that are being tested for
*/
export type ChainSpec = 'polkadot' | 'kusama' | 'westend' | 'statemine';
export type ChainSpec = 'polkadot' | 'kusama' | 'westend' | 'asset-hub-kusama';

/**
* Sidecar endpoints that are supported
Expand All @@ -43,6 +43,6 @@ export interface IChains {
kusama: ChainEndpoints;
polkadot: ChainEndpoints;
westend: ChainEndpoints;
statemine: ChainEndpoints;
statemint: ChainEndpoints;
'asset-hub-kusama': ChainEndpoints;
'asset-hub-polkadot': ChainEndpoints;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { IConfig } from '../types/endpoints';

export const statemint: IConfig = {
export const assetHubPolkadot: IConfig = {
'/accounts/{accountId}/asset-balances': {
path: '/accounts/1ULZhwpUPLLg5VRYiq6rBHY8XaShAmBW7kqGBfvHBqrgBcN/asset-balances',
queryParams: ['at={blockId}', 'assets[]=100&assets[]=123'],
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/latest/endpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

export * from './acala';
export * from './asset-hub-polkadot';
export * from './karura';
export * from './kusama';
export * from './polkadot';
export * from './statemint';
export * from './westend';
4 changes: 2 additions & 2 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This script calls the local historical e2e tests helper library in order to test

### Flags

`--chain`: This sets the specific chain to run the script against. Acceptable values are `['polkadot', 'westend', 'kusama', 'statemine', 'statemint']`. If no chain is selected it will default to run the e2e-tests against all chains.
`--chain`: This sets the specific chain to run the script against. Acceptable values are `['polkadot', 'westend', 'kusama', 'asset-hub-kusama', 'asset-hub-polkadot']`. If no chain is selected it will default to run the e2e-tests against all chains.

`--local`: This sets the websocket url for the e2e test. Its to be used along with `--chain`. If `--chain` is not present it will throw an error.

Expand All @@ -36,7 +36,7 @@ This script calls the local latest e2e tests helper library in order to test the

### Flags

`--chain`: This sets the specific chain to run the script against. Acceptable values are `['polkadot', 'statemint']`. If no chain is selected it will default to run the e2e-tests against all chains.
`--chain`: This sets the specific chain to run the script against. Acceptable values are `['polkadot', 'asset-hub-polkadot']`. If no chain is selected it will default to run the e2e-tests against all chains.

`--local`: This sets the websocket url for the e2e test. Its to be used along with `--chain`. If `--chain` is not present it will throw an error.

Expand Down
12 changes: 6 additions & 6 deletions scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ export const historicalE2eConfig: Record<string, IChainConfigE2E> = {
},
SasStartOpts: defaultSasStartOpts,
},
statemine: {
'asset-hub-kusama': {
wsUrl: 'wss://statemine-rpc.polkadot.io',
e2eStartOpts: {
...defaultJestOpts,
args: ['start:historical-e2e-tests', '--chain', 'statemine'],
args: ['start:historical-e2e-tests', '--chain', 'asset-hub-kusama'],
},
SasStartOpts: defaultSasStartOpts,
},
statemint: {
'asset-hub-polkadot': {
wsUrl: 'wss://statemint-rpc.polkadot.io',
e2eStartOpts: {
...defaultJestOpts,
args: ['start:historical-e2e-tests', '--chain', 'statemint'],
args: ['start:historical-e2e-tests', '--chain', 'asset-hub-polkadot'],
},
SasStartOpts: defaultSasStartOpts,
},
Expand All @@ -105,14 +105,14 @@ export const latestE2eConfig: Record<string, IChainConfigE2E> = {
args: ['start:latest-e2e-tests', '--chain', 'polkadot'],
},
},
statemint: {
'asset-hub-polkadot': {
wsUrl: 'wss://statemint-rpc.polkadot.io',
SasStartOpts: defaultSasStartOpts,
e2eStartOpts: {
proc: 'latest-e2e',
resolver: 'Finished with a status code of 0',
resolverFailed: 'Finished with a status code of 1',
args: ['start:latest-e2e-tests', '--chain', 'statemint'],
args: ['start:latest-e2e-tests', '--chain', 'asset-hub-polkadot'],
},
},
westend: {
Expand Down
20 changes: 13 additions & 7 deletions scripts/runHistoricalE2eTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ const main = async (args: IE2EParseArgs): Promise<void> => {
historicalE2eConfig,
procs
);
const statemineTest = await launchChainTest(
'statemine',
const assetHubKusamaTest = await launchChainTest(
'asset-hub-kusama',
historicalE2eConfig,
procs
);
const statemintTest = await launchChainTest(
'statemint',
const assetHubPolkadotTest = await launchChainTest(
'asset-hub-polkadot',
historicalE2eConfig,
procs
);
Expand All @@ -88,8 +88,8 @@ const main = async (args: IE2EParseArgs): Promise<void> => {
polkadotTest,
kusamaTest,
westendTest,
statemineTest,
statemintTest
assetHubKusamaTest,
assetHubPolkadotTest
);
}
};
Expand All @@ -104,7 +104,13 @@ parser.add_argument('--local', {
nargs: '?',
});
parser.add_argument('--chain', {
choices: ['polkadot', 'kusama', 'westend', 'statemine', 'statemint'],
choices: [
'polkadot',
'kusama',
'westend',
'asset-hub-kusama',
'asset-hub-polkadot',
],
});
parser.add_argument('--log-level', {
choices: ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'],
Expand Down
8 changes: 4 additions & 4 deletions scripts/runLatestE2eTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ const main = async (args: IE2EParseArgs) => {
);
const kusamaTest = await launchChainTest('kusama', latestE2eConfig, procs);
const westend = await launchChainTest('westend', latestE2eConfig, procs);
const statemintTest = await launchChainTest(
'statemint',
const assetHubPolkadotTest = await launchChainTest(
'asset-hub-polkadot',
latestE2eConfig,
procs
);

checkTests(polkadotTest, kusamaTest, westend, statemintTest);
checkTests(polkadotTest, kusamaTest, westend, assetHubPolkadotTest);
}
};

Expand All @@ -83,7 +83,7 @@ parser.add_argument('--local', {
nargs: '?',
});
parser.add_argument('--chain', {
choices: ['polkadot', 'kusama', 'westend', 'statemint'],
choices: ['polkadot', 'kusama', 'westend', 'asset-hub-polkadot'],
});
parser.add_argument('--log-level', {
choices: ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { ControllerConfig } from '../types/chains-config';
import { initLRUCache, QueryFeeDetailsCache } from './cache';

/**
* Statemine configuration for Sidecar.
* Asset Hub Kusama configuration for Sidecar.
*/
export const statemineControllers: ControllerConfig = {
export const assetHubKusamaControllers: ControllerConfig = {
controllers: [
'AccountsAssets',
'AccountsBalanceInfo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { ControllerConfig } from '../types/chains-config';
import { initLRUCache, QueryFeeDetailsCache } from './cache';

/**
* Statemint configuration for Sidecar.
* Asset Hub Polkadot configuration for Sidecar.
*/
export const statemintControllers: ControllerConfig = {
export const assetHubPolkadotControllers: ControllerConfig = {
controllers: [
'AccountsAssets',
'AccountsBalanceInfo',
Expand Down
Loading

0 comments on commit 362e912

Please sign in to comment.