-
Notifications
You must be signed in to change notification settings - Fork 2.6k
rpc: the arguments for api method are incorrect #14728
Comments
Did you follow some tutorial or how did you add it to the template? |
yeah,I followed some tutorials to add it to my template,sunch as https://substrate.stackexchange.com/questions/5554/how-to-add-custom-rpcs and https://github.com/AlexD10S/susbtrate-node-template/blob/rpc-custom-methods/pallets/template/rpc/src/lib.rs#L9 and others. I compared the codes among them and found that they did the same thing.But ,when I added the codes in my project, errors occured like that when it is built.So,maybe,I think wether the newest codes causing the problem,I am not sure. |
@AlexD10S do you know if the tutorial maybe needs an update? |
error[E0308]: mismatched types For more information about this error, try |
I have found the answer.Thanks. |
I am going to take a look, probably it needs an update. The tutorial was done with @Snikko If you have found an answer, can you share your solution here or in the StackExchange question with a new answer or editing mine. The community will benefit if you share your solution there. |
In recent versions,we have to change some codes in the file pallets/template/src/rpc/src/lib.rs,as follows:impl<C, Block> TemplateApiServer<::Hash> for TemplatePallet<C, Block>
} |
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
I want to add rpc function in my substrate blockchain to supply restful apis for others.But some mistake occur when the project is built.The errors show like this:
45 | api.get_value(&at,v).map_err(runtime_error_into_rpc_err)
| --------- ^^^ expected associated type, found
&BlockId<_>
| |
| arguments to this method are incorrect
Steps to reproduce
1、add rpc configuration to the prject correctly
2、build the project
3、errors like this:
45 | api.get_value(&at,v).map_err(runtime_error_into_rpc_err)
| --------- ^^^ expected associated type, found
&BlockId<_>
| |
| arguments to this method are incorrect
The text was updated successfully, but these errors were encountered: