mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 04:01:10 +00:00
Double map and plain storage support, introduce macros (#93)
* Support custom clients. * Simplify trait bounds. * Plain and double map storage support. * Simplify more trait bounds. * Add proc macro. * Add Call, Event and Store traits. * Update proc-macros. * Add with_system for proc-macro. * proc-macro: test: support signature and extra fields. * proc-macro: test: support sharing state accross steps. * proc-macro: test: fetch state sequentially. * Elide lifetimes. * Add test for plain storage. * Run rustfmt.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
extern crate proc_macro;
|
||||
|
||||
mod call;
|
||||
mod event;
|
||||
mod module;
|
||||
mod store;
|
||||
mod test;
|
||||
mod utils;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
use synstructure::{
|
||||
decl_derive,
|
||||
Structure,
|
||||
};
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn module(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||
module::module(args.into(), input.into()).into()
|
||||
}
|
||||
|
||||
decl_derive!([Call] => call);
|
||||
fn call(s: Structure) -> TokenStream {
|
||||
call::call(s).into()
|
||||
}
|
||||
|
||||
decl_derive!([Event] => event);
|
||||
fn event(s: Structure) -> TokenStream {
|
||||
event::event(s).into()
|
||||
}
|
||||
|
||||
decl_derive!([Store, attributes(store)] => store);
|
||||
fn store(s: Structure) -> TokenStream {
|
||||
store::store(s).into()
|
||||
}
|
||||
|
||||
#[proc_macro]
|
||||
pub fn subxt_test(input: TokenStream) -> TokenStream {
|
||||
test::test(input.into()).into()
|
||||
}
|
||||
Reference in New Issue
Block a user