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(dev-deps): update @substrate/dev to 0.7.1 #1356

Merged
merged 6 commits into from
Nov 20, 2023
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
7 changes: 6 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
module.exports = require('@substrate/dev/config/prettier');
const config = require('@substrate/dev/config/prettier');

module.exports = {
...config,
printWidth: 120,
}
8 changes: 2 additions & 6 deletions e2e-tests/helpers/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ export interface IRequest {
statusCode?: number;
}

export const request = (
path: string,
hostname: string,
port: number
): Promise<IRequest> => {
export const request = (path: string, hostname: string, port: number): Promise<IRequest> => {
return new Promise((resolve) => {
http.get({ path, hostname, port }, (response) => {
let data = '';
Expand All @@ -36,7 +32,7 @@ export const request = (
data,
path,
statusCode: response.statusCode,
})
}),
);
});
});
Expand Down
33 changes: 11 additions & 22 deletions e2e-tests/historical-e2e-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,9 @@
import { HOST, PORT } from './helpers/consts';
import { request } from './helpers/request';
import { endpoints } from './historical/endpoints';
import {
AccountsResponse,
ChainSpec,
IBlockResponse,
IEnvChainConfig,
RuntimeResponse,
} from './historical/types';

const config = JSON.parse(
process.env.__SAS_RUNTIME_TEST_CONFIGURATION as string
) as IEnvChainConfig;
import { AccountsResponse, ChainSpec, IBlockResponse, IEnvChainConfig, RuntimeResponse } from './historical/types';

const config = JSON.parse(process.env.__SAS_RUNTIME_TEST_CONFIGURATION as string) as IEnvChainConfig;

const chain = config.chain as ChainSpec;
const TIMEOUT_MS = 60000;
Expand All @@ -41,15 +33,12 @@ describe('Runtime Tests for blocks', () => {
* Test runtimes for `/blocks`
*/
if (blocks.length) {
test.each(blocks)(
'Given path %p, it should return the correct JSON response',
async (blockPath, blockResponse) => {
const res = await request(blockPath, HOST, PORT);
const responseJson = JSON.parse(res.data) as IBlockResponse;
test.each(blocks)('Given path %p, it should return the correct JSON response', async (blockPath, blockResponse) => {
const res = await request(blockPath, HOST, PORT);
const responseJson = JSON.parse(res.data) as IBlockResponse;

expect(responseJson).toStrictEqual(JSON.parse(blockResponse));
}
);
expect(responseJson).toStrictEqual(JSON.parse(blockResponse));
});
}
});

Expand All @@ -67,7 +56,7 @@ describe('Runtime Tests for accounts', () => {
const responseJson = JSON.parse(res.data) as AccountsResponse;

expect(responseJson).toStrictEqual(JSON.parse(accountsResponse));
}
},
);
}
});
Expand All @@ -83,7 +72,7 @@ describe('Runtime Tests for `/runtime/*`', () => {
const responseJson = JSON.parse(res.data) as RuntimeResponse;

expect(responseJson).toStrictEqual(JSON.parse(runtimeResponse));
}
},
);
}
});
Expand All @@ -100,7 +89,7 @@ describe('Runtime Tests for `/paras/*`', () => {
const responseJson = JSON.parse(res.data);

expect(responseJson).toStrictEqual(JSON.parse(runtimeResponse));
}
},
);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@

import runtimeSpec993450 from './993450.json';

export const assetHubKusamaRuntimeEndpoints = [
['/runtime/spec?at=993540', JSON.stringify(runtimeSpec993450)],
];
export const assetHubKusamaRuntimeEndpoints = [['/runtime/spec?at=993540', JSON.stringify(runtimeSpec993450)]];
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@

import runtimeSpec340000 from './340000.json';

export const assetHubKusamaRuntimeEndpoints = [
['/runtime/spec?at=340000', JSON.stringify(runtimeSpec340000)],
];
export const assetHubKusamaRuntimeEndpoints = [['/runtime/spec?at=340000', JSON.stringify(runtimeSpec340000)]];
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@

import block1800000 from './1800000.json';

export const assetHubWestendBlockEndpoints = [
['/blocks/10000', JSON.stringify(block1800000)],
];
export const assetHubWestendBlockEndpoints = [['/blocks/10000', JSON.stringify(block1800000)]];
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@

import runtimeSpec5216878 from './5216878.json';

export const assetHubWestendRuntimeEndpoints = [
['/runtime/spec?at=5216878', JSON.stringify(runtimeSpec5216878)],
];
export const assetHubWestendRuntimeEndpoints = [['/runtime/spec?at=5216878', JSON.stringify(runtimeSpec5216878)]];
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ import validateKusamaHex from './validateKusamaHex.json';
import validateKusamaSS58 from './validateKusamaSS58.json';

export const kusamaAccountValidateEndpoints = [
[
'/accounts/DXgXPAT5zWtPHo6FhVvrDdiaDPgCNGxhJAeVBYLtiwW9hAc/validate',
JSON.stringify(validateKusamaSS58),
],
['/accounts/DXgXPAT5zWtPHo6FhVvrDdiaDPgCNGxhJAeVBYLtiwW9hAc/validate', JSON.stringify(validateKusamaSS58)],
[
'/accounts/0x02ce046d43fc4c0fb8b3b754028515e5020f5f1d8d620b4ef0f983c5df34b1952909e9/validate',
JSON.stringify(validateKusamaHex),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,48 +27,15 @@ import parasAuctionsCurrent11800000 from './11800000.json';
import parasAuctionsCurrent11821201 from './11821201.json';

export const parasAuctionsCurrentEndpoints = [
[
'/paras/auctions/current?at=8351749',
JSON.stringify(parasAuctionsCurrent8351749),
], // v9070 - startPeriod
[
'/paras/auctions/current?at=8400000',
JSON.stringify(parasAuctionsCurrent8400000),
], // v9070 - endingPeriod
[
'/paras/auctions/current?at=8423750',
JSON.stringify(parasAuctionsCurrent8423750),
], // v9070 - vrfDelay (Only need to check this case once)
[
'/paras/auctions/current?at=9828507',
JSON.stringify(parasAuctionsCurrent9828507),
], // v9111 - startPeriod
[
'/paras/auctions/current?at=9905872',
JSON.stringify(parasAuctionsCurrent9905872),
], // v9111 - endingPeriod
[
'/paras/auctions/current?at=11115599',
JSON.stringify(parasAuctionsCurrent11115599),
], // v9151 - startPeriod
[
'/paras/auctions/current?at=11187599',
JSON.stringify(parasAuctionsCurrent11187599),
], // v9151 - endingPeriod
[
'/paras/auctions/current?at=11500000',
JSON.stringify(parasAuctionsCurrent11500000),
], // v9160 - startingPeriod
[
'/paras/auctions/current?at=11590799',
JSON.stringify(parasAuctionsCurrent11590799),
], // v9160 - endingPeriod
[
'/paras/auctions/current?at=11800000',
JSON.stringify(parasAuctionsCurrent11800000),
], // v9170 - startingPeriod
[
'/paras/auctions/current?at=11821201',
JSON.stringify(parasAuctionsCurrent11821201),
], // v9170 - endingPeriod
['/paras/auctions/current?at=8351749', JSON.stringify(parasAuctionsCurrent8351749)], // v9070 - startPeriod
['/paras/auctions/current?at=8400000', JSON.stringify(parasAuctionsCurrent8400000)], // v9070 - endingPeriod
['/paras/auctions/current?at=8423750', JSON.stringify(parasAuctionsCurrent8423750)], // v9070 - vrfDelay (Only need to check this case once)
['/paras/auctions/current?at=9828507', JSON.stringify(parasAuctionsCurrent9828507)], // v9111 - startPeriod
['/paras/auctions/current?at=9905872', JSON.stringify(parasAuctionsCurrent9905872)], // v9111 - endingPeriod
['/paras/auctions/current?at=11115599', JSON.stringify(parasAuctionsCurrent11115599)], // v9151 - startPeriod
['/paras/auctions/current?at=11187599', JSON.stringify(parasAuctionsCurrent11187599)], // v9151 - endingPeriod
['/paras/auctions/current?at=11500000', JSON.stringify(parasAuctionsCurrent11500000)], // v9160 - startingPeriod
['/paras/auctions/current?at=11590799', JSON.stringify(parasAuctionsCurrent11590799)], // v9160 - endingPeriod
['/paras/auctions/current?at=11800000', JSON.stringify(parasAuctionsCurrent11800000)], // v9170 - startingPeriod
['/paras/auctions/current?at=11821201', JSON.stringify(parasAuctionsCurrent11821201)], // v9170 - endingPeriod
];
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,13 @@ import parasCrowdloanInfo11500000 from './11500000.json';
import parasCrowdloanInfo11800000 from './11800000.json';

export const parasCrowdloanInfoEndpoints = [
[
'/paras/2023/crowdloan-info?at=8367200',
JSON.stringify(parasCrowdloanInfo8367200),
], // v9070
[
'/paras/2077/crowdloan-info?at=9000000',
JSON.stringify(parasCrowdloanInfo9000000),
], // v9090
[
'/paras/2077/crowdloan-info?at=9810000',
JSON.stringify(parasCrowdloanInfo9810000),
], // v9111
[
'/paras/2077/crowdloan-info?at=10119301',
JSON.stringify(parasCrowdloanInfo10119301),
], // v9122
[
'/paras/2008/crowdloan-info?at=10819301',
JSON.stringify(parasCrowdloanInfo10819301),
], // v9130
[
'/paras/2096/crowdloan-info?at=11000000',
JSON.stringify(parasCrowdloanInfo11000000),
], // v9150
[
'/paras/2096/crowdloan-info?at=11100000',
JSON.stringify(parasCrowdloanInfo11100000),
], // v9151
[
'/paras/2096/crowdloan-info?at=11500000',
JSON.stringify(parasCrowdloanInfo11500000),
], // v9160
[
'/paras/2096/crowdloan-info?at=11800000',
JSON.stringify(parasCrowdloanInfo11800000),
], // v9170
['/paras/2023/crowdloan-info?at=8367200', JSON.stringify(parasCrowdloanInfo8367200)], // v9070
['/paras/2077/crowdloan-info?at=9000000', JSON.stringify(parasCrowdloanInfo9000000)], // v9090
['/paras/2077/crowdloan-info?at=9810000', JSON.stringify(parasCrowdloanInfo9810000)], // v9111
['/paras/2077/crowdloan-info?at=10119301', JSON.stringify(parasCrowdloanInfo10119301)], // v9122
['/paras/2008/crowdloan-info?at=10819301', JSON.stringify(parasCrowdloanInfo10819301)], // v9130
['/paras/2096/crowdloan-info?at=11000000', JSON.stringify(parasCrowdloanInfo11000000)], // v9150
['/paras/2096/crowdloan-info?at=11100000', JSON.stringify(parasCrowdloanInfo11100000)], // v9151
['/paras/2096/crowdloan-info?at=11500000', JSON.stringify(parasCrowdloanInfo11500000)], // v9160
['/paras/2096/crowdloan-info?at=11800000', JSON.stringify(parasCrowdloanInfo11800000)], // v9170
];
30 changes: 6 additions & 24 deletions e2e-tests/historical/endpoints/kusama/paras/lease-info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,10 @@ export const parasLeaseInfoEndpoints = [
['/paras/2007/lease-info?at=8500000', JSON.stringify(parasLeaseInfo8500000)], // v9070
['/paras/2000/lease-info?at=9000000', JSON.stringify(parasLeaseInfo9000000)], // v9090
['/paras/2023/lease-info?at=9800000', JSON.stringify(parasLeaseInfo9800000)], // v9111
[
'/paras/2023/lease-info?at=10119301',
JSON.stringify(parasLeaseInfo10119301),
], // v9122
[
'/paras/2023/lease-info?at=10819301',
JSON.stringify(parasLeaseInfo10819301),
], // v9130
[
'/paras/2096/lease-info?at=11000000',
JSON.stringify(parasLeaseInfo11000000),
], // v9150
[
'/paras/2096/lease-info?at=11100000',
JSON.stringify(parasLeaseInfo11100000),
], // v9151
[
'/paras/2096/lease-info?at=11500000',
JSON.stringify(parasLeaseInfo11500000),
], // v9160
[
'/paras/2096/lease-info?at=11800000',
JSON.stringify(parasLeaseInfo11800000),
], // v9170
['/paras/2023/lease-info?at=10119301', JSON.stringify(parasLeaseInfo10119301)], // v9122
['/paras/2023/lease-info?at=10819301', JSON.stringify(parasLeaseInfo10819301)], // v9130
['/paras/2096/lease-info?at=11000000', JSON.stringify(parasLeaseInfo11000000)], // v9150
['/paras/2096/lease-info?at=11100000', JSON.stringify(parasLeaseInfo11100000)], // v9151
['/paras/2096/lease-info?at=11500000', JSON.stringify(parasLeaseInfo11500000)], // v9160
['/paras/2096/lease-info?at=11800000', JSON.stringify(parasLeaseInfo11800000)], // v9170
];
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,13 @@ import parasLeasesCurrent11500000 from './11500000.json';
import parasLeasesCurrent11800000 from './11800000.json';

export const parasLeasesCurrentEndpoints = [
[
'/paras/leases/current?at=8200000',
JSON.stringify(parasLeasesCurrent8200000),
], // v9070
[
'/paras/leases/current?at=9000000',
JSON.stringify(parasLeasesCurrent9000000),
], // v9090
[
'/paras/leases/current?at=9800000',
JSON.stringify(parasLeasesCurrent9800000),
], // v9111
[
'/paras/leases/current?at=10119301',
JSON.stringify(parasLeasesCurrent10119301),
], // v9122
[
'/paras/leases/current?at=10819301',
JSON.stringify(parasLeasesCurrent10819301),
], // v9130
[
'/paras/leases/current?at=11000000',
JSON.stringify(parasLeasesCurrent11000000),
], // v9150
[
'/paras/leases/current?at=11100000',
JSON.stringify(parasLeasesCurrent11100000),
], // v9151
[
'/paras/leases/current?at=11500000',
JSON.stringify(parasLeasesCurrent11500000),
], // v9160
[
'/paras/leases/current?at=11800000',
JSON.stringify(parasLeasesCurrent11800000),
], // v9170
['/paras/leases/current?at=8200000', JSON.stringify(parasLeasesCurrent8200000)], // v9070
['/paras/leases/current?at=9000000', JSON.stringify(parasLeasesCurrent9000000)], // v9090
['/paras/leases/current?at=9800000', JSON.stringify(parasLeasesCurrent9800000)], // v9111
['/paras/leases/current?at=10119301', JSON.stringify(parasLeasesCurrent10119301)], // v9122
['/paras/leases/current?at=10819301', JSON.stringify(parasLeasesCurrent10819301)], // v9130
['/paras/leases/current?at=11000000', JSON.stringify(parasLeasesCurrent11000000)], // v9150
['/paras/leases/current?at=11100000', JSON.stringify(parasLeasesCurrent11100000)], // v9151
['/paras/leases/current?at=11500000', JSON.stringify(parasLeasesCurrent11500000)], // v9160
['/paras/leases/current?at=11800000', JSON.stringify(parasLeasesCurrent11800000)], // v9170
];
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ import validatePolkadotHex from './validatePolkadotHex.json';
import validatePolkadotSS58 from './validatePolkadotSS58.json';

export const polkadotAccountValidateEndpoints = [
[
'/accounts/1xN1Q5eKQmS5AzASdjt6R6sHF76611vKR4PFpFjy1kXau4m/validate',
JSON.stringify(validatePolkadotSS58),
],
['/accounts/1xN1Q5eKQmS5AzASdjt6R6sHF76611vKR4PFpFjy1kXau4m/validate', JSON.stringify(validatePolkadotSS58)],
[
'/accounts/0x002a39366f6620a6c2e2fed5990a3d419e6a19dd127fc7a50b515cf17e2dc5cc592312/validate',
JSON.stringify(validatePolkadotHex),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ import validateWestendHex from './validateWestendHex.json';
import validateWestendSS58 from './validateWestendSS58.json';

export const westendAccountValidateEndpoints = [
[
'/accounts/5CdnmxQUfK6WPreBauvetcLh5PZL4RMPHrtd3nPQpQ9Z2qCS/validate',
JSON.stringify(validateWestendSS58),
],
['/accounts/5CdnmxQUfK6WPreBauvetcLh5PZL4RMPHrtd3nPQpQ9Z2qCS/validate', JSON.stringify(validateWestendSS58)],
[
'/accounts/0x2a193ba804b76499944080c91b8b38b749a482471c317ab8bfa43f52d5ff9c04c7f6bf/validate',
JSON.stringify(validateWestendHex),
Expand Down
10 changes: 1 addition & 9 deletions e2e-tests/historical/historical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ const argv = process.argv.slice(0, 2);
const parser = new ArgumentParser();

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

/**
* Sidecar endpoints that are supported
Expand Down
Loading
Loading