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:
David Craven
2020-04-28 21:04:26 +02:00
committed by GitHub
parent 216b5614dd
commit 6f27489378
20 changed files with 1924 additions and 501 deletions
+39
View File
@@ -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()
}