difftreelog
test forbid creating ApiPromise without set endpoint
in: master
4 files changed
tests/src/.outdated/substrate/substrate-api.tsdiffbeforeafterboth--- a/tests/src/.outdated/substrate/substrate-api.ts
+++ b/tests/src/.outdated/substrate/substrate-api.ts
@@ -71,6 +71,7 @@
export async function getApiConnection(settings: ApiOptions | undefined = undefined): Promise<ApiPromise> {
settings = settings || defaultApiOptions();
+ if(!settings.provider) throw new Error('provider was not set');
const api = new ApiPromise(settings);
if (api) {
tests/src/eth/createCollection.test.tsdiffbeforeafterboth217 const collection = helper.nft.getCollectionObject(collectionId);217 const collection = helper.nft.getCollectionObject(collectionId);218 const data = (await collection.getData())!;218 const data = (await collection.getData())!;219219220 // Parallel test safety220 expect(collectionCountAfter - collectionCountBefore).to.be.eq(1);221 expect(collectionCountAfter - collectionCountBefore).to.be.gte(1);221 expect(collectionId).to.be.eq(collectionCountAfter);222 expect(collectionId).to.be.eq(collectionCountAfter);222 expect(data.name).to.be.eq(name);223 expect(data.name).to.be.eq(name);223 expect(data.description).to.be.eq(description);224 expect(data.description).to.be.eq(description);tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -278,6 +278,7 @@
}
async connect(wsEndpoint: string, _listeners?: any): Promise<void> {
+ if(!wsEndpoint) throw new Error('wsEndpoint was not set');
const wsProvider = new WsProvider(wsEndpoint);
this.api = new ApiPromise({
provider: wsProvider,
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -492,6 +492,7 @@
}
static async detectNetworkByWsEndpoint(wsEndpoint: string): Promise<TNetworks> {
+ if(!wsEndpoint) throw new Error('wsEndpoint was not set');
const api = new ApiPromise({provider: new WsProvider(wsEndpoint)});
await api.isReady;
@@ -507,6 +508,7 @@
network: TNetworks;
}> {
if(typeof network === 'undefined' || network === null) network = 'opal';
+ if(!wsEndpoint) throw new Error('wsEndpoint was not set');
const supportedRPC = {
opal: {
unique: require('@unique-nft/opal-testnet-types/definitions').unique.rpc,