-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Transaction payment runtime api: query call info and fee details #11819
Transaction payment runtime api: query call info and fee details #11819
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should create a follow up issue with https://github.com/polkadot-js/api so that the new API is supported there.
Why is this a problem? |
I know that I'm a little bit pedantic here. |
It was an honest question. I want to know why you think it is better to fail later within the runtime. I don't understand why that changes anything compatibility wise. Clients still need to encode it according to whatever the runtime expects. I think it is better to have the type defined on the runtime API so it is obvious for clients what the signature of the API is. Otherwise they need to look into the actual code that decodes it later to know what is expected. Additionally, the plan is to expose runtime APIs through metadata just like extrinsics which would be totally pointless if all types are opaque. |
Hmm yeah good point and sorry for my useless answer. Yeah, maybe we should treat them as some sort of special runtime api. In the future we should probably provide some way to expose these apis more easily from the runtime. Aka not requiring first to declare the api somewhere else. |
So we go back to declaring the proper type in the API? I am not sure what the implications are. i.e where does the decoding failure happen. |
Balance: Codec + MaybeDisplay, | ||
Call: Codec, | ||
{ | ||
/// Query information of a dispatch class, weight, and fee of a given encoded `Call`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed panic, since the implementation itself is not supposed to panic, only upstream state_call
bot merge |
…itytech#11819) * Transaction payment RPC calls: query call info * transaction payment pallet - runtime api - add query_call info and fee_details * remove unused deps * separate call runtime api * undo fmt for unchanged code * system config call bounded to GetDispatchInfo, drop Call generic for query call info/fee * impl GetDispatchInfo for Extrinsics within runtime test-utils * introduced runtime api methods accept encoded Call instead of Call type * replace Bytes by Vec, docs for for new api, drop len argument, drop GetDispatchInfo bound from system_Config::Call * clean up toml and extra impl for dropped bound * panic if Call can not be decoded * revert to 6d0ca79 * fmt and docs * rustfmt
…itytech#11819) * Transaction payment RPC calls: query call info * transaction payment pallet - runtime api - add query_call info and fee_details * remove unused deps * separate call runtime api * undo fmt for unchanged code * system config call bounded to GetDispatchInfo, drop Call generic for query call info/fee * impl GetDispatchInfo for Extrinsics within runtime test-utils * introduced runtime api methods accept encoded Call instead of Call type * replace Bytes by Vec, docs for for new api, drop len argument, drop GetDispatchInfo bound from system_Config::Call * clean up toml and extra impl for dropped bound * panic if Call can not be decoded * revert to 6d0ca79 * fmt and docs * rustfmt
Related #11665
New rpc and runtime api calls to query weights and fee for
Call
.Use case:
BuyExecution
for XCMTransact
operation, to executeCall
.Requirements:
api.rpc.state.call
for light clients (not only RPC calls)Useful links: