fp_storage/
lib.rs

1// This file is part of Frontier.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// 	http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18#![cfg_attr(not(feature = "std"), no_std)]
19#![warn(unused_crate_dependencies)]
20
21use scale_codec::{Decode, Encode};
22
23/// Some storage constants
24pub mod constants {
25	/// Pallet Evm storage items
26	pub const PALLET_EVM: &[u8] = b"EVM";
27	pub const EVM_ACCOUNT_CODES: &[u8] = b"AccountCodes";
28	pub const EVM_ACCOUNT_STORAGES: &[u8] = b"AccountStorages";
29
30	/// Pallet Ethereum storage items
31	pub const PALLET_ETHEREUM: &[u8] = b"Ethereum";
32	pub const ETHEREUM_CURRENT_BLOCK: &[u8] = b"CurrentBlock";
33	pub const ETHEREUM_CURRENT_RECEIPTS: &[u8] = b"CurrentReceipts";
34	pub const ETHEREUM_CURRENT_TRANSACTION_STATUSES: &[u8] = b"CurrentTransactionStatuses";
35
36	/// Pallet BaseFee storage items
37	pub const PALLET_BASE_FEE: &[u8] = b"BaseFee";
38	pub const BASE_FEE_PER_GAS: &[u8] = b"BaseFeePerGas";
39	pub const BASE_FEE_ELASTICITY: &[u8] = b"Elasticity";
40}
41
42/// Current version of pallet Ethereum's storage schema is stored under this key.
43pub const PALLET_ETHEREUM_SCHEMA: &[u8] = b":ethereum_schema";
44/// Cached version of pallet Ethereum's storage schema is stored under this key in the AuxStore.
45pub const PALLET_ETHEREUM_SCHEMA_CACHE: &[u8] = b":ethereum_schema_cache";
46
47/// The schema version for Pallet Ethereum's storage
48#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode)]
49#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
50pub enum EthereumStorageSchema {
51	// deprecated
52	// #[codec(index = 0)]
53	// Undefined,
54	#[codec(index = 1)]
55	V1,
56	#[codec(index = 2)]
57	V2,
58	#[codec(index = 3)]
59	V3,
60}