-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Private view functions cannot be called after 1.11.0 #358
Comments
Will take a look into it when I get back. Looks like the ABI doesn't include private view functions. You can override remote ABI for now using a hard coded one like this, which will provide type safety and better performance |
@gregnazario The example you provided is for entry functions. Is there a way to provide ABI for view function? |
Yes. Take a look at the view function api. The
|
@0xmaayan I found that to use this, we need to construct an ABI object of the function. How to construct the ABI with an plain ABI json? |
We could optionally instead provide the ability to use a view function without an ABI, but you will have to encode the arguments as BCS, and get it right (with no hints). Maybe need to make a ABI generator minimally. |
🐛 Bug Description
Before ts-sdk 1.11.0, a private view function is callable through the sdk. However, after #334, calling private view function will result in
Could not find view function ABI
error. It's because a private view function won't be listed in ABI, and #334 add a ABI verification when calling view function.For example,
0xc6bc659f1649553c1a3fa05d9727433dc03843baac29473c817d06d39e7621ba::lending::preview_account_liquidity_given_withdraw
is a private view function, which cannot be found in ABI: https://explorer.aptoslabs.com/account/0xc6bc659f1649553c1a3fa05d9727433dc03843baac29473c817d06d39e7621ba/modules/code/lending?network=mainnetAccording to the Aptos document:
Private view functions are considered a feature. It's suggested that either these functions be included in the ABI or the SDK not raise exceptions for functions absent from the ABI.
How to reproduce
The text was updated successfully, but these errors were encountered: