git.delta.rocks / unique-network / refs/commits / 38fabb78bb57

difftreelog

Hide unneeded debug output

Greg Zaitsev2021-02-01parent: #0379d3a.patch.diff
in: master

2 files changed

modifiedtests/src/setSchemaVersion.test.tsdiffbeforeafterboth
9898
99 it('execute setSchemaVersion with not correct schema version', async () => {99 it('execute setSchemaVersion with not correct schema version', async () => {
100 await usingApi(async (api: ApiPromise) => {100 await usingApi(async (api: ApiPromise) => {
101 const consoleError = console.error;
102 console.error = (message: string) => {};
101 try {103 try {
102 tx = api.tx.nft.setSchemaVersion(collectionIdForTesting, 'Test');104 tx = api.tx.nft.setSchemaVersion(collectionIdForTesting, 'Test');
103 await submitTransactionAsync(alice, tx);105 await submitTransactionAsync(alice, tx);
104 } catch (e) {106 } catch (e) {
105 // tslint:disable-next-line:no-unused-expression107 // tslint:disable-next-line:no-unused-expression
106 expect(e).to.be.exist;108 expect(e).to.be.exist;
107 }109 } finally {
110 console.error = consoleError;
111 }
108 });112 });
109 });113 });
110114
modifiedtests/src/substrate/substrate-api.tsdiffbeforeafterboth
2424
25 // TODO: Remove, this is temporary: Filter unneeded API output 25 // TODO: Remove, this is temporary: Filter unneeded API output
26 // (Jaco promised it will be removed in the next version)26 // (Jaco promised it will be removed in the next version)
27 // const consoleLog = console.log;27 const consoleLog = console.log;
28 // console.log = (message: string) => {28 console.log = (message: string) => {
29 // if (!(message.includes("API/INIT: Capabilities detected") || message.includes("2021-"))) {29 if (message.includes("API/INIT: Capabilities detected") || message.includes("2021-")) {}
30 // consoleLog(message);30 else if (message.includes("StorageChangeSet:: WebSocket is not connected") || message.includes("2021-")) {}
31 // }31 else consoleLog(message);
32 // };32 };
33 const consoleErr = console.error;
34 console.error = (message: string) => {
35 if (message.includes("StorageChangeSet:: WebSocket is not connected") || message.includes("2021-")) {}
36 else consoleErr(message);
37 };
3338
34 try {39 try {
35 await promisifySubstrate(api, async () => {40 await promisifySubstrate(api, async () => {
40 })();45 })();
41 } finally {46 } finally {
42 await api.disconnect();47 await api.disconnect();
43 // console.log = consoleLog;48 console.log = consoleLog;
49 console.error = consoleErr;
44 }50 }
45}51}
4652
115 await transaction.signAndSend(sender, ({ events = [], status }) => {121 await transaction.signAndSend(sender, ({ events = [], status }) => {
116 const transactionStatus = getTransactionStatus(events, status);122 const transactionStatus = getTransactionStatus(events, status);
117123
118 console.log('transactionStatus', transactionStatus, 'events', events);124 // console.log('transactionStatus', transactionStatus, 'events', events);
119125
120 if (transactionStatus == TransactionStatus.Success) {126 if (transactionStatus == TransactionStatus.Success) {
121 resolve(events);127 resolve(events);