refactor: employ prettier

This commit is contained in:
Michael Vines
2018-11-04 11:41:21 -08:00
parent 9a043344d5
commit 1d6abb17cf
35 changed files with 1498 additions and 856 deletions

View File

@@ -13,9 +13,8 @@ export async function sendAndConfirmTransaction(
connection: Connection,
from: Account,
transaction: Transaction,
runtimeErrorOk: boolean = false
runtimeErrorOk: boolean = false,
): Promise<?TransactionSignature> {
let sendRetries = 10;
let signature;
for (;;) {
@@ -34,12 +33,18 @@ export async function sendAndConfirmTransaction(
await sleep(500);
if (--statusRetries <= 0) {
const duration = (Date.now() - start) / 1000;
throw new Error(`Transaction '${signature}' was not confirmed in ${duration.toFixed(2)} seconds (${status})`);
throw new Error(
`Transaction '${signature}' was not confirmed in ${duration.toFixed(
2,
)} seconds (${status})`,
);
}
}
if ( (status === 'Confirmed') ||
(status === 'ProgramRuntimeError' && runtimeErrorOk) ) {
if (
status === 'Confirmed' ||
(status === 'ProgramRuntimeError' && runtimeErrorOk)
) {
break;
}
@@ -53,4 +58,3 @@ export async function sendAndConfirmTransaction(
return signature;
}