mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-03-04 04:51:21 +00:00
remove async await lint warnings
This commit is contained in:
parent
7efe3cbe8c
commit
9714fc9dab
@ -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 () => {
|
||||
|
@ -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 => {
|
||||
|
@ -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 => {
|
||||
|
@ -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 () => {
|
||||
|
@ -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 => {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user