Fix linter errors

This commit is contained in:
Leonid Logvinov 2018-12-12 10:59:31 -08:00
parent 2b523a36c5
commit 0e76d66f24
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
2 changed files with 9 additions and 9 deletions

View File

@ -23,7 +23,7 @@ export type sendTransactionResult = Promise<TransactionReceipt | TransactionRece
* @returns either the given ganacheError or gethError depending on the backing
* node.
*/
async function _getGanacheOrGethError(ganacheError: string, gethError: string): Promise<string> {
async function _getGanacheOrGethErrorAsync(ganacheError: string, gethError: string): Promise<string> {
if (_.isUndefined(nodeType)) {
nodeType = await web3Wrapper.getNodeTypeAsync();
}
@ -38,15 +38,15 @@ async function _getGanacheOrGethError(ganacheError: string, gethError: string):
}
async function _getInsufficientFundsErrorMessageAsync(): Promise<string> {
return _getGanacheOrGethError("sender doesn't have enough funds", 'insufficient funds');
return _getGanacheOrGethErrorAsync("sender doesn't have enough funds", 'insufficient funds');
}
async function _getTransactionFailedErrorMessageAsync(): Promise<string> {
return _getGanacheOrGethError('revert', 'always failing transaction');
return _getGanacheOrGethErrorAsync('revert', 'always failing transaction');
}
async function _getContractCallFailedErrorMessageAsync(): Promise<string> {
return _getGanacheOrGethError('revert', 'Contract call failed');
return _getGanacheOrGethErrorAsync('revert', 'Contract call failed');
}
/**
@ -54,7 +54,7 @@ async function _getContractCallFailedErrorMessageAsync(): Promise<string> {
* contract call. The exact error message depends on the backing Ethereum node.
*/
export async function getInvalidOpcodeErrorMessageForCallAsync(): Promise<string> {
return _getGanacheOrGethError('invalid opcode', 'Contract call failed');
return _getGanacheOrGethErrorAsync('invalid opcode', 'Contract call failed');
}
/**
@ -65,7 +65,7 @@ export async function getInvalidOpcodeErrorMessageForCallAsync(): Promise<string
* @returns the expected error message.
*/
export async function getRevertReasonOrErrorMessageForSendTransactionAsync(reason: RevertReason): Promise<string> {
return _getGanacheOrGethError(reason, 'always failing transaction');
return _getGanacheOrGethErrorAsync(reason, 'always failing transaction');
}
/**

View File

@ -26,7 +26,7 @@ type PromiseResult<T> = Value<T> | ErrorMessage;
// TODO(albrow): This seems like a generic utility function that could exist in
// lodash. We should replace it by a library implementation, or move it to our
// own.
async function evaluatePromise<T>(promise: Promise<T>): Promise<PromiseResult<T>> {
async function evaluatePromiseAsync<T>(promise: Promise<T>): Promise<PromiseResult<T>> {
try {
return new Value<T>(await promise);
} catch (e) {
@ -93,10 +93,10 @@ export async function testWithReferenceFuncAsync(
values: any[],
): Promise<void> {
// Measure correct behaviour
const expected = await evaluatePromise(referenceFuncAsync(...values));
const expected = await evaluatePromiseAsync(referenceFuncAsync(...values));
// Measure actual behaviour
const actual = await evaluatePromise(testFuncAsync(...values));
const actual = await evaluatePromiseAsync(testFuncAsync(...values));
// Compare behaviour
if (expected instanceof ErrorMessage) {