Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Chainlink Dependencies #7

Merged
merged 8 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/src/components/place-bet-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import { useState } from 'react'
import { useSearchParams } from 'next/navigation'
import { formatEther, parseEther } from 'viem'
import { useAccount, useBalance } from 'wagmi'
import {
Expand Down Expand Up @@ -28,6 +29,9 @@ export default function PlaceBetButton({
const { data } = useBalance({ address })
const { predictions, setPredictions } = useLocalStateContext()

const searchParams = useSearchParams()
const testMode = searchParams.get('mode') === 'test'

const placePredictions = async () => {
setError(null)
if (predictions.some((p) => p.wager === undefined || p.wager <= 0)) {
Expand Down Expand Up @@ -79,14 +83,18 @@ export default function PlaceBetButton({
args: [gameId],
})
if (game.externalId === BigInt(0)) {
// Bypassing the registration guard for test mode
const timestamp = testMode
? BigInt(Math.floor(Date.now() / 1000) + 300)
: BigInt(prediction.game.timestamp)
const config = await prepareWriteContract({
address: contractAddress,
abi: sportsPredictionGameABI,
functionName: 'registerAndPredict',
args: [
BigInt(prediction.game.sportId),
BigInt(prediction.game.id),
BigInt(prediction.game.timestamp),
timestamp,
winnerToResult[prediction.predictedWinner],
],
value: parseEther(`${prediction.wager ?? 0}`),
Expand Down
143 changes: 0 additions & 143 deletions contracts/FunctionsSandboxLibrary/Functions.js

This file was deleted.

59 changes: 0 additions & 59 deletions contracts/FunctionsSandboxLibrary/Log.js

This file was deleted.

81 changes: 0 additions & 81 deletions contracts/FunctionsSandboxLibrary/Sandbox.js

This file was deleted.

69 changes: 0 additions & 69 deletions contracts/FunctionsSandboxLibrary/Validator.js

This file was deleted.

Loading
Loading