mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 11:39:35 +00:00
Support trailing commas in create_db
This commit is contained in:
parent
be48dcc4a4
commit
6e4ecbc90c
7 changed files with 7 additions and 7 deletions
|
@ -38,7 +38,7 @@ pub fn serai_db_key(
|
|||
#[macro_export]
|
||||
macro_rules! create_db {
|
||||
($db_name: ident {
|
||||
$($field_name: ident: ($($arg: ident: $arg_type: ty),*) -> $field_type: ty),*
|
||||
$($field_name: ident: ($($arg: ident: $arg_type: ty),*) -> $field_type: ty$(,)?)*
|
||||
}) => {
|
||||
$(
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
|
@ -29,7 +29,7 @@ use crate::{
|
|||
create_db! {
|
||||
CosignDb {
|
||||
ReceivedCosign: (set: ValidatorSet, block: [u8; 32]) -> Vec<u8>,
|
||||
DistinctChain: (set: ValidatorSet) -> ()
|
||||
DistinctChain: (set: ValidatorSet) -> (),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ create_db! {
|
|||
CosignTriggered: () -> (),
|
||||
IntendedCosign: () -> (u64, Option<u64>),
|
||||
BlockHasEvents: (block: u64) -> u8,
|
||||
CosignTransactions: (network: NetworkId) -> Vec<(Session, u64, [u8; 32])>
|
||||
CosignTransactions: (network: NetworkId) -> Vec<(Session, u64, [u8; 32])>,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ use crate::tributary::TributarySpec;
|
|||
|
||||
create_db! {
|
||||
NewTributaryDb {
|
||||
SeraiBlockNumber: (hash: [u8; 32]) -> u64
|
||||
SeraiBlockNumber: (hash: [u8; 32]) -> u64,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ const PLAN_SIGNING_CODE: u8 = 3;
|
|||
create_db!(
|
||||
NonceDeciderDb {
|
||||
NextNonceDb: (genesis: [u8; 32]) -> u32,
|
||||
ItemNonceDb: (genesis: [u8; 32], code: u8, id: &[u8]) -> u32
|
||||
ItemNonceDb: (genesis: [u8; 32], code: u8, id: &[u8]) -> u32,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ use crate::{Get, DbTxn, create_db};
|
|||
create_db! {
|
||||
CosignerDb {
|
||||
Completed: (id: [u8; 32]) -> (),
|
||||
Attempt: (id: [u8; 32], attempt: u32) -> ()
|
||||
Attempt: (id: [u8; 32], attempt: u32) -> (),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ create_db!(
|
|||
// These do assume a key is only used once across sets, which holds true so long as a single
|
||||
// participant is honest in their execution of the protocol
|
||||
KeysDb: (network_key: &[u8]) -> Vec<u8>,
|
||||
NetworkKey: (substrate_key: [u8; 32]) -> Vec<u8>
|
||||
NetworkKey: (substrate_key: [u8; 32]) -> Vec<u8>,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue