Use proc macros to generate conversion functions for MultiLocation (#3635)

* Use proc macros to generate conversion functions for MultiLocation

* Add compile test and missing conversion cases

* Add common derives for Parent and Ancestor

* Generate conversion functions for MultiLocation v0 via proc macro

* Add type conversion test and fix a bug

* cargo fmt

* Do not hardcode 8 as the number of max parents

* Use map instead of for loops when generating code fragments

* Spelling

* cargo fmt

* More mapping, less for-looping
This commit is contained in:
Keith Yeung
2021-08-19 02:24:55 -07:00
committed by GitHub
parent d88dec65fb
commit 8feed6aedb
11 changed files with 486 additions and 647 deletions
+13
View File
@@ -0,0 +1,13 @@
[package]
authors = ["Parity Technologies <admin@parity.io>"]
name = "xcm-procedural"
version = "0.1.0"
edition = "2018"
[lib]
proc-macro = true
[dependencies]
proc-macro2 = "1.0.28"
quote = "1.0.9"
syn = "1.0.74"