Remove the timestamp pallet

It was needed for contracts, which has since been removed. We now no longer
need it.
This commit is contained in:
Luke Parker 2023-01-04 23:09:58 -05:00
parent e979883f2d
commit daa88a051f
No known key found for this signature in database
6 changed files with 5 additions and 27 deletions

2
Cargo.lock generated
View file

@ -7262,7 +7262,6 @@ dependencies = [
"sp-keystore", "sp-keystore",
"sp-runtime", "sp-runtime",
"sp-tendermint", "sp-tendermint",
"sp-timestamp",
"substrate-build-script-utils", "substrate-build-script-utils",
"substrate-frame-rpc-system", "substrate-frame-rpc-system",
"validator-sets-pallet", "validator-sets-pallet",
@ -7313,7 +7312,6 @@ dependencies = [
"pallet-balances", "pallet-balances",
"pallet-session", "pallet-session",
"pallet-tendermint", "pallet-tendermint",
"pallet-timestamp",
"pallet-transaction-payment", "pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api", "pallet-transaction-payment-rpc-runtime-api",
"parity-scale-codec", "parity-scale-codec",

View file

@ -27,7 +27,6 @@ sp-application-crypto = { git = "https://github.com/serai-dex/substrate" }
sp-keystore = { git = "https://github.com/serai-dex/substrate" } sp-keystore = { git = "https://github.com/serai-dex/substrate" }
sp-keyring = { git = "https://github.com/serai-dex/substrate" } sp-keyring = { git = "https://github.com/serai-dex/substrate" }
sp-inherents = { git = "https://github.com/serai-dex/substrate" } sp-inherents = { git = "https://github.com/serai-dex/substrate" }
sp-timestamp = { git = "https://github.com/serai-dex/substrate" }
sp-runtime = { git = "https://github.com/serai-dex/substrate" } sp-runtime = { git = "https://github.com/serai-dex/substrate" }
sp-blockchain = { git = "https://github.com/serai-dex/substrate" } sp-blockchain = { git = "https://github.com/serai-dex/substrate" }
sp-api = { git = "https://github.com/serai-dex/substrate" } sp-api = { git = "https://github.com/serai-dex/substrate" }

View file

@ -1,8 +1,8 @@
use std::{sync::Arc, time::Duration}; use std::sync::Arc;
use sp_core::{Encode, Pair}; use sp_core::{Encode, Pair};
use sp_keyring::Sr25519Keyring; use sp_keyring::Sr25519Keyring;
use sp_inherents::{InherentData, InherentDataProvider}; use sp_inherents::InherentData;
use sp_runtime::OpaqueExtrinsic; use sp_runtime::OpaqueExtrinsic;
@ -87,11 +87,5 @@ pub fn create_benchmark_extrinsic(
} }
pub fn inherent_benchmark_data() -> Result<InherentData> { pub fn inherent_benchmark_data() -> Result<InherentData> {
let mut inherent_data = InherentData::new(); Ok(InherentData::new())
futures::executor::block_on(
sp_timestamp::InherentDataProvider::new(Duration::from_millis(0).into())
.provide_inherent_data(&mut inherent_data),
)
.map_err(|e| format!("creating inherent data: {e:?}"))?;
Ok(inherent_data)
} }

View file

@ -57,13 +57,13 @@ impl NativeExecutionDispatch for ExecutorDispatch {
pub struct Cidp; pub struct Cidp;
#[async_trait::async_trait] #[async_trait::async_trait]
impl CreateInherentDataProviders<Block, ()> for Cidp { impl CreateInherentDataProviders<Block, ()> for Cidp {
type InherentDataProviders = (sp_timestamp::InherentDataProvider,); type InherentDataProviders = ();
async fn create_inherent_data_providers( async fn create_inherent_data_providers(
&self, &self,
_: <Block as BlockTrait>::Hash, _: <Block as BlockTrait>::Hash,
_: (), _: (),
) -> Result<Self::InherentDataProviders, Box<dyn Send + Sync + Error>> { ) -> Result<Self::InherentDataProviders, Box<dyn Send + Sync + Error>> {
Ok((sp_timestamp::InherentDataProvider::from_system_time(),)) Ok(())
} }
} }

View file

@ -36,7 +36,6 @@ frame-support = { git = "https://github.com/serai-dex/substrate", default-featur
frame-executive = { git = "https://github.com/serai-dex/substrate", default-features = false } frame-executive = { git = "https://github.com/serai-dex/substrate", default-features = false }
frame-benchmarking = { git = "https://github.com/serai-dex/substrate", default-features = false, optional = true } frame-benchmarking = { git = "https://github.com/serai-dex/substrate", default-features = false, optional = true }
pallet-timestamp = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-balances = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-balances = { git = "https://github.com/serai-dex/substrate", default-features = false }
pallet-transaction-payment = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-transaction-payment = { git = "https://github.com/serai-dex/substrate", default-features = false }
@ -73,7 +72,6 @@ std = [
"frame-support/std", "frame-support/std",
"frame-executive/std", "frame-executive/std",
"pallet-timestamp/std",
"pallet-balances/std", "pallet-balances/std",
"pallet-transaction-payment/std", "pallet-transaction-payment/std",
@ -94,7 +92,6 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks", "frame-support/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-balances/runtime-benchmarks", "pallet-balances/runtime-benchmarks",
"pallet-tendermint/runtime-benchmarks", "pallet-tendermint/runtime-benchmarks",

View file

@ -28,7 +28,6 @@ use frame_support::{
}; };
pub use frame_system::Call as SystemCall; pub use frame_system::Call as SystemCall;
pub use pallet_timestamp::Call as TimestampCall;
pub use pallet_balances::Call as BalancesCall; pub use pallet_balances::Call as BalancesCall;
use pallet_transaction_payment::CurrencyAdapter; use pallet_transaction_payment::CurrencyAdapter;
@ -162,13 +161,6 @@ impl frame_system::Config for Runtime {
type MaxConsumers = frame_support::traits::ConstU32<16>; type MaxConsumers = frame_support::traits::ConstU32<16>;
} }
impl pallet_timestamp::Config for Runtime {
type Moment = u64;
type OnTimestampSet = ();
type MinimumPeriod = ConstU64<{ TARGET_BLOCK_TIME / 2 }>;
type WeightInfo = ();
}
impl pallet_balances::Config for Runtime { impl pallet_balances::Config for Runtime {
type MaxLocks = ConstU32<50>; type MaxLocks = ConstU32<50>;
type MaxReserves = (); type MaxReserves = ();
@ -249,7 +241,6 @@ construct_runtime!(
UncheckedExtrinsic = UncheckedExtrinsic UncheckedExtrinsic = UncheckedExtrinsic
{ {
System: frame_system, System: frame_system,
Timestamp: pallet_timestamp,
Balances: pallet_balances, Balances: pallet_balances,
TransactionPayment: pallet_transaction_payment, TransactionPayment: pallet_transaction_payment,
@ -269,7 +260,6 @@ mod benches {
[frame_benchmarking, BaselineBench::<Runtime>] [frame_benchmarking, BaselineBench::<Runtime>]
[frame_system, SystemBench::<Runtime>] [frame_system, SystemBench::<Runtime>]
[pallet_balances, Balances] [pallet_balances, Balances]
[pallet_timestamp, Timestamp]
); );
} }