Fix vanity command by taking the network into account (#7192)

* Fix vanity command by taking the network into account

* Delete empty line

* Apply suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Change test

* Stupid me

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Bastian Köcher
2020-09-23 18:30:12 +02:00
committed by GitHub
parent 4e5f9fb72b
commit a00f0bf81c
2 changed files with 38 additions and 12 deletions
+9 -3
View File
@@ -215,10 +215,16 @@ pub fn read_message(msg: Option<&String>, should_decode: bool) -> Result<Vec<u8>
/// Allows for calling $method with appropriate crypto impl.
#[macro_export]
macro_rules! with_crypto_scheme {
($scheme:expr, $method:ident($($params:expr),*)) => {
with_crypto_scheme!($scheme, $method<>($($params),*))
(
$scheme:expr,
$method:ident ( $($params:expr),* $(,)?) $(,)?
) => {
$crate::with_crypto_scheme!($scheme, $method<>($($params),*))
};
($scheme:expr, $method:ident<$($generics:ty),*>($($params:expr),*)) => {
(
$scheme:expr,
$method:ident<$($generics:ty),*>( $( $params:expr ),* $(,)?) $(,)?
) => {
match $scheme {
$crate::CryptoScheme::Ecdsa => {
$method::<sp_core::ecdsa::Pair, $($generics),*>($($params),*)