remove async await lint warnings

This commit is contained in:
Barry Gitarts 2019-08-27 10:38:15 -04:00 committed by Barry G
parent 7efe3cbe8c
commit 9714fc9dab
8 changed files with 13 additions and 13 deletions

View File

@ -49,7 +49,7 @@ const batchAddDelegates = async (pledges, profiles, existing) => {
}
})
})
return database.action(async () => await database.batch(...batch))
return database.action(async () => database.batch(...batch))
}
export const updateDelegates = async () => {

View File

@ -27,7 +27,7 @@ export const batchAddEvents = async events => {
lpEvent.returnValues = returnValues
})
})
return await database.action(async () => await database.batch(...batch))
return database.action(async () => database.batch(...batch))
}
export const getLatestProfileEvents = async eventIds => {

View File

@ -22,7 +22,7 @@ const createPledge = (pledge, data, profiles) => {
const pledgesCollection = database.collections.get('pledges')
export const addPledge = async data => {
return await database.action(async () => {
return database.action(async () => {
const res = await pledgesCollection.create(pledge => createPledge(pledge, data))
return res
})
@ -32,7 +32,7 @@ export const batchAddPledges = async (pledges, profiles = []) => {
const batch = pledges.map(data => {
return pledgesCollection.prepareCreate(pledge => createPledge(pledge, data, profiles))
})
return await database.action(async () => await database.batch(...batch))
return database.action(async () => database.batch(...batch))
}
const getLastPledge = pledges => {

View File

@ -5,7 +5,7 @@ import { formatFundProfileEvent } from '../utils/events'
const profilesCollection = database.collections.get('profiles')
export const addProfile = async data => {
return await database.action(async () => {
return database.action(async () => {
const res = await profilesCollection.create(profile => {
const { id, addr, canceled, commitTime, type, name, url, idProfile } = data
profile.eventId = id
@ -35,7 +35,7 @@ export const batchAddProfiles = async profiles => {
profile.idProfile = Number(idProfile)
})
})
return await database.action(async () => await database.batch(...batch))
return database.action(async () => database.batch(...batch))
}
export const addFormattedProfiles = async () => {

View File

@ -29,7 +29,7 @@ export const batchAddEvents = async events => {
lpEvent.returnValues = returnValues
})
})
return await database.action(async () => await database.batch(...batch))
return database.action(async () => database.batch(...batch))
}
export const getVaultEventById = async id => {

View File

@ -19,7 +19,7 @@ export default class VaultEvent extends Model {
@json('return_values', sanitizeValues) returnValues
@action async addEvent(data) {
return await this.create(lpEvent => {
return this.create(lpEvent => {
const { event, address, id, blockNumber } = data
lpEvent.eventId = id
lpEvent.address = address

View File

@ -83,10 +83,10 @@ export const lpEventsSubscription = async () => {
})
return events
}
export const getFunderProfiles = async () => await getPastEvents(GIVER_ADDED)
export const getDelegateProfiles = async () => await getPastEvents(DELEGATE_ADDED)
export const getProjectProfiles = async () => await getPastEvents(PROJECT_ADDED)
export const getAllLPEvents = async fromBlock => await getPastEvents(
export const getFunderProfiles = async () => getPastEvents(GIVER_ADDED)
export const getDelegateProfiles = async () => getPastEvents(DELEGATE_ADDED)
export const getProjectProfiles = async () => getPastEvents(PROJECT_ADDED)
export const getAllLPEvents = async fromBlock => getPastEvents(
ALL_EVENTS,
true,
fromBlock

View File

@ -28,7 +28,7 @@ export const vaultPledgingNeedsInit = async () => {
export const standardTokenApproval = async (contract, amount = '10000000') => {
const { methods: { approve } } = contract || SNT
const spender = LiquidPledging._address
return await approve(
return approve(
spender,
web3.utils.toWei(amount, 'tether')
).send()