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 type: string
} }
export interface ContractInterface { export interface MethodInterface {
constant: boolean constant: boolean
inputs: InterfaceParams[] inputs: InterfaceParams[]
name: string name: string
@ -14,12 +14,12 @@ export interface ContractInterface {
type: string type: string
} }
export interface ExtendedContractInterface extends ContractInterface { export interface ExtendedContractInterface extends MethodInterface {
action: string action: string
methodSignature: string methodSignature: string
signatureHash: string signatureHash: string
} }
export type ABI = ContractInterface[] export type ABI = MethodInterface[]
export type ExtendedABI = ExtendedContractInterface[] 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 { useDropdownStyles } from 'src/routes/safe/components/CurrencyDropdown/style'
import { DropdownListTheme } from 'src/theme/mui' import { DropdownListTheme } from 'src/theme/mui'
import { extractUsefulMethods } from 'src/logic/contractInteraction/sources/ABIService' import { extractUsefulMethods } from 'src/logic/contractInteraction/sources/ABIService'
import { MethodInterface } from 'src/logic/contractInteraction/sources/ABIService/types'
const MENU_WIDTH = '452px' const MENU_WIDTH = '452px'
interface MethodsDropdownProps { interface MethodsDropdownProps {
onChange: ({}) => void onChange: (method: MethodInterface) => void
} }
const MethodsDropdown = ({ onChange }: MethodsDropdownProps) => { const MethodsDropdown = ({ onChange }: MethodsDropdownProps) => {
@ -60,7 +61,7 @@ const MethodsDropdown = ({ onChange }: MethodsDropdownProps) => {
setAnchorEl(null) setAnchorEl(null)
} }
const onMethodSelectedChanged = (chosenMethod) => { const onMethodSelectedChanged = (chosenMethod: MethodInterface) => {
setSelectedMethod(chosenMethod) setSelectedMethod(chosenMethod)
onChange(chosenMethod) onChange(chosenMethod)
handleClose() handleClose()

View File

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