difftreelog
test forbid creating ApiPromise without set endpoint
in: master
4 files changed
tests/src/.outdated/substrate/substrate-api.tsdiffbeforeafterboth717172export async function getApiConnection(settings: ApiOptions | undefined = undefined): Promise<ApiPromise> {72export async function getApiConnection(settings: ApiOptions | undefined = undefined): Promise<ApiPromise> {73 settings = settings || defaultApiOptions();73 settings = settings || defaultApiOptions();74 if(!settings.provider) throw new Error('provider was not set');74 const api = new ApiPromise(settings);75 const api = new ApiPromise(settings);757676 if (api) {77 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.tsdiffbeforeafterboth278 }278 }279279280 async connect(wsEndpoint: string, _listeners?: any): Promise<void> {280 async connect(wsEndpoint: string, _listeners?: any): Promise<void> {281 if(!wsEndpoint) throw new Error('wsEndpoint was not set');281 const wsProvider = new WsProvider(wsEndpoint);282 const wsProvider = new WsProvider(wsEndpoint);282 this.api = new ApiPromise({283 this.api = new ApiPromise({283 provider: wsProvider,284 provider: wsProvider,tests/src/util/playgrounds/unique.tsdiffbeforeafterboth492 }492 }493493494 static async detectNetworkByWsEndpoint(wsEndpoint: string): Promise<TNetworks> {494 static async detectNetworkByWsEndpoint(wsEndpoint: string): Promise<TNetworks> {495 if(!wsEndpoint) throw new Error('wsEndpoint was not set');495 const api = new ApiPromise({provider: new WsProvider(wsEndpoint)});496 const api = new ApiPromise({provider: new WsProvider(wsEndpoint)});496 await api.isReady;497 await api.isReady;497498507 network: TNetworks;508 network: TNetworks;508 }> {509 }> {509 if(typeof network === 'undefined' || network === null) network = 'opal';510 if(typeof network === 'undefined' || network === null) network = 'opal';511 if(!wsEndpoint) throw new Error('wsEndpoint was not set');510 const supportedRPC = {512 const supportedRPC = {511 opal: {513 opal: {512 unique: require('@unique-nft/opal-testnet-types/definitions').unique.rpc,514 unique: require('@unique-nft/opal-testnet-types/definitions').unique.rpc,