Skip to content

Commit

Permalink
fix: also in sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarranzav committed Jan 11, 2024
1 parent 8910037 commit bb98512
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/sdk/src/deployments/lib/contracts/tx-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import type {
import type { Provider } from '@ethersproject/providers'
import type { ContractParam } from '../types/contract'

class WrappedContract {
// The meta-class properties
[key: string]: ContractFunction | any
}

/**
* Modifies a contract connect function to return a contract wrapped with {@link wrapCalls}
*
Expand Down Expand Up @@ -45,7 +50,7 @@ export function getWrappedConnect(
* @returns the wrapped contract
*/
export function wrapCalls(contract: Contract, contractName: string): Contract {
const wrappedContract = lodash.cloneDeep(contract)
const wrappedContract = lodash.cloneDeep(contract) as WrappedContract

for (const fn of Object.keys(contract.functions)) {
const call: ContractFunction<ContractTransaction> = contract.functions[fn]
Expand All @@ -66,7 +71,7 @@ export function wrapCalls(contract: Contract, contractName: string): Contract {
wrappedContract.functions[fn] = override
}

return wrappedContract
return wrappedContract as Contract
}

function logContractCall(
Expand Down

0 comments on commit bb98512

Please sign in to comment.