import type { ContractReceipt } from '@enzymefinance/ethers' ; import { extractEvent } from '@enzymefinance/ethers' ; import type { utils } from 'ethers' ; export function assertEvent < TResult = any > ( receipt , event , match ? ) { const events = extractEvent ( receipt , event ) ; expect ( events . length ) . toBe ( 1 ) ; expect ( receipt ) . toHaveEmittedWith ( event , match ) ; const args = events . shift ( ) ?. args ; return ( args as unknown as typeof match ) ! ; } export function assertNoEvent ( receipt , event ) { const events = extractEvent ( receipt , event ) ; expect ( events . length ) . toBe ( 0 ) ; }