Skip to content

Commit

Permalink
fix a bunch of warnings coming out of eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hatch committed Dec 20, 2023
1 parent c7eea86 commit 5a3bc1e
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 203 deletions.
22 changes: 0 additions & 22 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ const handleCliFailure = (error, res, wasmFilePath) => {
return res.status(500).send('internal server error')
}

const wabtToolRoute = (subpath, toolPath) =>
app.post(subpath, limiter, upload.single('contract'), (req, res) => {
console.log(subpath)
if (!req.file) {
return res.status(400).send('No file was uploaded.')
}
const filePath = path.join(req.file.destination, req.file.filename)
const wasmFilePath = filePath + '.wasm'
fs.renameSync(filePath, wasmFilePath)

exec(`${toolPath} ${wasmFilePath}`, (error, stdout, stderr) => {
if (error) {
return handleCliFailure(error, res, wasmFilePath)
}

fs.unlinkSync(wasmFilePath)

res.contentType('text/plain')
res.send(stdout)
})
})

const wabtToolRoute = (subpath, toolPath) =>
app.post(subpath, decompileLimiter, upload.single('contract'), (req, res) => {
if (!req.file) {
Expand Down
5 changes: 2 additions & 3 deletions app/components/Effect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import RelativeTime from './shared/RelativeTime'
import TransactionHash from './shared/TransactionHash'

import { base64Decode } from '../lib/utils'
import Unrecognized from './operations/Unrecognized'
import {
LiquidityPoolDeposit,
LiquidityPoolWithdraw,
Expand Down Expand Up @@ -394,10 +393,10 @@ const EffectDetails = ({ effect, op }: any) => {
function Effect({
effect,
showAccount = true,
}: {
}: Readonly<{
effect: EffectProps
showAccount: boolean
}) {
}>) {
const opId = effect.op?.id
const txHash = effect.op?.transaction_hash
return (
Expand Down
20 changes: 2 additions & 18 deletions app/components/OperationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,19 @@ import React from 'react'
import Table from 'react-bootstrap/Table'
import { FormattedMessage } from 'react-intl'

import {
default as Operation,
operationTypesKeys,
} from './operations/Operation'
import { filterFor } from './shared/OperationType'

const filterFn = (event: React.ChangeEvent<HTMLSelectElement>) => {
filterFor(event.target.value)
}
import { default as Operation } from './operations/Operation'

export interface OperationTableProps {
compact: boolean
records: ReadonlyArray<any>
horizonURL?: string
}

const getOperationTypeFilter = () => {
console.error("FIXME - can't use window.location - useLocation?")
// const opTypeFilter = window.location.search.match(/opTypeFilter=([a-z_]*)/)
// if (opTypeFilter?.[1]) {
// return opTypeFilter[1]
// }
}

export default function OperationTable({
compact,
records,
horizonURL, // possiblyMoreDataAvailable,
}: OperationTableProps) {
}: Readonly<OperationTableProps>) {
return (
<div>
{/* TODO: restore the filter */}
Expand Down
8 changes: 3 additions & 5 deletions app/components/shared/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'
import PropTypes from 'prop-types'
import type { KnownAccountType } from '~/data/known_accounts'

// 2 supported logo forms
Expand All @@ -12,11 +10,11 @@ const imagesInBoth = ['papayabot', 'papayaswap', 'ripplefox']
export default function Logo({
name,
type,
}: {
}: Readonly<{
name?: string
type: KnownAccountType
}) {
const nameLower = name?.toLowerCase() || ''
}>) {
const nameLower = name?.toLowerCase() ?? ''
const imgSrc = `/img/${nameLower}.png`
const dimen =
type !== 'exchange' || imagesInBoth.indexOf(nameLower) !== -1
Expand Down
Loading

0 comments on commit 5a3bc1e

Please sign in to comment.