mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 22:27:56 +00:00
Introduce a PhantomData field in GenesisConfig (#1116)
This makes it possible to support `GenesisConfig`s that to do not use generic parameter.
This commit is contained in:
@@ -211,7 +211,10 @@ mod tests {
|
||||
#[test]
|
||||
fn timestamp_works() {
|
||||
let mut t = system::GenesisConfig::<Test>::default().build_storage().unwrap().0;
|
||||
t.extend(GenesisConfig::<Test> { period: 0 }.build_storage().unwrap().0);
|
||||
t.extend(GenesisConfig::<Test> {
|
||||
period: 5,
|
||||
_genesis_phantom_data: Default::default()
|
||||
}.build_storage().unwrap().0);
|
||||
|
||||
with_externalities(&mut TestExternalities::new(t), || {
|
||||
Timestamp::set_timestamp(42);
|
||||
@@ -224,7 +227,10 @@ mod tests {
|
||||
#[should_panic(expected = "Timestamp must be updated only once in the block")]
|
||||
fn double_timestamp_should_fail() {
|
||||
let mut t = system::GenesisConfig::<Test>::default().build_storage().unwrap().0;
|
||||
t.extend(GenesisConfig::<Test> { period: 5 }.build_storage().unwrap().0);
|
||||
t.extend(GenesisConfig::<Test> {
|
||||
period: 5,
|
||||
_genesis_phantom_data: Default::default()
|
||||
}.build_storage().unwrap().0);
|
||||
|
||||
with_externalities(&mut TestExternalities::new(t), || {
|
||||
Timestamp::set_timestamp(42);
|
||||
@@ -237,7 +243,10 @@ mod tests {
|
||||
#[should_panic(expected = "Timestamp must increment by at least <BlockPeriod> between sequential blocks")]
|
||||
fn block_period_is_enforced() {
|
||||
let mut t = system::GenesisConfig::<Test>::default().build_storage().unwrap().0;
|
||||
t.extend(GenesisConfig::<Test> { period: 5 }.build_storage().unwrap().0);
|
||||
t.extend(GenesisConfig::<Test> {
|
||||
period: 5,
|
||||
_genesis_phantom_data: Default::default()
|
||||
}.build_storage().unwrap().0);
|
||||
|
||||
with_externalities(&mut TestExternalities::new(t), || {
|
||||
Timestamp::set_timestamp(42);
|
||||
|
||||
Reference in New Issue
Block a user