Skip to content

Commit

Permalink
Add debug output to execute message calls
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenStueber committed May 15, 2024
1 parent 3c7f0d8 commit 1fc6f8c
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions src/hooks/nabla/useContractWrite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,27 @@ export function useContractWrite<TAbi extends Record<string, unknown>>({
console.log('write', 'call message write', address, method, args, submitArgs);
}

const response = await executeMessage({
abi: contractAbi,
api,
callerAddress: walletAddress,
contractDeploymentAddress: address,
getSigner: () =>
Promise.resolve({
type: 'signer',
address: walletAddress,
signer,
}),
messageName: method,
messageArguments: fnArgs,
limits: { ...defaultWriteLimits, ...contractOptions },
gasLimitTolerancePercentage: 10, // Allow 3 fold gas tolerance
});
try {
const response = await executeMessage({
abi: contractAbi,
api,
callerAddress: walletAddress,
contractDeploymentAddress: address,
getSigner: () =>
Promise.resolve({
type: 'signer',
address: walletAddress,
signer,
}),
messageName: method,
messageArguments: fnArgs,
limits: { ...defaultWriteLimits, ...contractOptions },
gasLimitTolerancePercentage: 10, // Allow 3 fold gas tolerance
});
} catch (error) {
console.error('An error occurred', error);
throw error;
}

if (isDevelopment) {
console.log('write', 'call message write response', address, method, fnArgs, response);

Check failure on line 75 in src/hooks/nabla/useContractWrite.ts

View workflow job for this annotation

GitHub Actions / Running ci (18)

Cannot find name 'response'. Did you mean 'Response'?
Expand Down

0 comments on commit 1fc6f8c

Please sign in to comment.