fix 'non-empty-pattern' ts warning

This commit is contained in:
fernandomg 2020-06-02 10:50:32 -03:00
parent 7dfa7af41d
commit 95a753cbe5
3 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,7 @@ export interface InterfaceParams {
type: string
}
export interface ContractInterface {
export interface MethodInterface {
constant: boolean
inputs: InterfaceParams[]
name: string
@ -14,12 +14,12 @@ export interface ContractInterface {
type: string
}
export interface ExtendedContractInterface extends ContractInterface {
export interface ExtendedContractInterface extends MethodInterface {
action: string
methodSignature: string
signatureHash: string
}
export type ABI = ContractInterface[]
export type ABI = MethodInterface[]
export type ExtendedABI = ExtendedContractInterface[]

View File

@ -16,11 +16,12 @@ import CheckIcon from 'src/routes/safe/components/CurrencyDropdown/img/check.svg
import { useDropdownStyles } from 'src/routes/safe/components/CurrencyDropdown/style'
import { DropdownListTheme } from 'src/theme/mui'
import { extractUsefulMethods } from 'src/logic/contractInteraction/sources/ABIService'
import { MethodInterface } from 'src/logic/contractInteraction/sources/ABIService/types'
const MENU_WIDTH = '452px'
interface MethodsDropdownProps {
onChange: ({}) => void
onChange: (method: MethodInterface) => void
}
const MethodsDropdown = ({ onChange }: MethodsDropdownProps) => {
@ -60,7 +61,7 @@ const MethodsDropdown = ({ onChange }: MethodsDropdownProps) => {
setAnchorEl(null)
}
const onMethodSelectedChanged = (chosenMethod) => {
const onMethodSelectedChanged = (chosenMethod: MethodInterface) => {
setSelectedMethod(chosenMethod)
onChange(chosenMethod)
handleClose()

View File

@ -33,7 +33,7 @@ export interface ContractInteractionProps {
contractAddress: string
initialValues: { contractAddress?: string }
onClose: () => void
onNext: ({}: CreatedTx) => void
onNext: (tx: CreatedTx) => void
}
const ContractInteraction = ({ contractAddress, initialValues, onClose, onNext }: ContractInteractionProps) => {