-
Notifications
You must be signed in to change notification settings - Fork 354
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
How do I inspect the flags
from an RPC call using polkadot-js api?
#4389
Comments
I have no idea about the contract results/flags as stated, have not delved into the newest contract interfaces/RPCs for quite some time. It is quite possibly related to the above. (Quickly took a peek and it indeed seems very much api related as opposed to UI related where it was logged) |
I did a bit of digging, where the flags do come through is on the const { result } = await abi.query.something(123);
if (result.isOk) {
const { flags } = result.asOk;
console.log(flags.toNumber());
} They don't appear on |
Thanks for the quick response. That's great I can get them from I should have provided a bit more info. |
|
Please read the docs carefully, https://polkadot.js.org/docs/substrate/errors#contractreverted , it states - "The contract ran to completion but decided to revert its storage changes." Why it occurs ^^^ "Please note that this error is only returned from extrinsics." Error is returned from extrinsics only ^^ "When called directly or via RPC an Ok will be returned." RPC behaves different, e.g. always returns Ok, no error. "In this case the caller needs to inspect the flags to determine whether a reversion has taken place." The above applies to the last case, when called via RPC. (No flags in extrinsics) |
Thanks, I think I understand. polkadotjs calls substrate via RPC and is therefore only ever given an |
This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
Hi, in the docs it states for
ContractReverted
:Can these flags currently be viewed using
polkadot-js api
or is it waiting on this? When I call my contract function that should be reverted there are noflags
in theISubmittableResult
.The text was updated successfully, but these errors were encountered: