Skip to content

Commit

Permalink
edit logs
Browse files Browse the repository at this point in the history
  • Loading branch information
aeolianeth committed Dec 30, 2024
1 parent 4dec75c commit d3a95d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
12 changes: 5 additions & 7 deletions src/hooks/ContractReader/useContractReadValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ export function useContractReadValue<C extends string, V>({
const newValue = _formatter(result)

if (_valueDidChange(value, newValue)) {
console.info(
`πŸ“— New >`,
functionName,
{ args },
{ newValue },
{ contract: readContract?.address },
)
console.info(`πŸ“— New >`, functionName, {
args,
newValue,
contract: readContract?.address,
})
setValue(newValue)
}
} catch (err) {
Expand Down
17 changes: 7 additions & 10 deletions src/hooks/ContractReader/util/useCallContractRead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ export async function callContractRead<T extends string>({
try {
console.info(`πŸ“š Read >`, functionName)
return await readContract[functionName](...(args ?? []))
} catch (err) {
console.error(
`πŸ“• Read error >`,
functionName,
{ args },
{ err },
{ contract: readContract.address },
{ contracts },
)
} catch (error) {
console.error(`πŸ“• Read error >`, functionName, error, {
args,
contract: readContract.address,
contracts,
})

throw err
throw error
}
}

0 comments on commit d3a95d4

Please sign in to comment.