mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-30 15:39:49 +00:00
Generate dispatch code from macro impl_stubs.
This commit is contained in:
1 parent
692770e03f
commit
652b5705d6
3 files changed
+11
-18
No files matched your search
@@ -131,7 +131,16 @@ pub fn print<T: Printable + Sized>(value: T) {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! impl_stubs {
|
||||
($( $name:ident ),*) => {}
|
||||
($( $name:ident ),*) => {
|
||||
pub fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
match method {
|
||||
$(
|
||||
stringify!($name) => Some($name(data)),
|
||||
)*
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user