remove hasUserHitManaLimit
This commit is contained in:
parent
76020d20ef
commit
30241ee0f2
|
@ -8,7 +8,6 @@ import { Answer, MAX_ANSWER_LENGTH } from 'common/answer'
|
|||
import { getContract, getValues } from './utils'
|
||||
import { sendNewAnswerEmail } from './emails'
|
||||
import { Bet } from '../../common/bet'
|
||||
import { hasUserHitManaLimit } from '../../common/calculate'
|
||||
|
||||
export const createAnswer = functions.runWith({ minInstances: 1 }).https.onCall(
|
||||
async (
|
||||
|
@ -62,13 +61,6 @@ export const createAnswer = functions.runWith({ minInstances: 1 }).https.onCall(
|
|||
)
|
||||
const yourBets = yourBetsSnap.docs.map((doc) => doc.data() as Bet)
|
||||
|
||||
const { status, message } = hasUserHitManaLimit(
|
||||
contract,
|
||||
yourBets,
|
||||
amount
|
||||
)
|
||||
if (status === 'error') return { status, message: message }
|
||||
|
||||
const [lastAnswer] = await getValues<Answer>(
|
||||
firestore
|
||||
.collection(`contracts/${contractId}/answers`)
|
||||
|
|
|
@ -13,7 +13,6 @@ import { addObjects, removeUndefinedProps } from 'common/util/object'
|
|||
import { Bet } from 'common/bet'
|
||||
import { redeemShares } from './redeem-shares'
|
||||
import { Fees } from 'common/fees'
|
||||
import { hasUserHitManaLimit } from 'common/calculate'
|
||||
|
||||
export const placeBet = functions.runWith({ minInstances: 1 }).https.onCall(
|
||||
async (
|
||||
|
@ -70,13 +69,6 @@ export const placeBet = functions.runWith({ minInstances: 1 }).https.onCall(
|
|||
)
|
||||
if (!answerSnap.exists)
|
||||
return { status: 'error', message: 'Invalid contract' }
|
||||
|
||||
const { status, message } = hasUserHitManaLimit(
|
||||
contract,
|
||||
yourBets,
|
||||
amount
|
||||
)
|
||||
if (status === 'error') return { status, message: message }
|
||||
}
|
||||
|
||||
const newBetDoc = firestore
|
||||
|
|
Loading…
Reference in New Issue
Block a user