Skip to content

Commit 7d90c6d

Browse files
committed
Upgrade Substrate to latest master branch in old repository
1 parent b5d1092 commit 7d90c6d

15 files changed

Lines changed: 502 additions & 265 deletions

File tree

Cargo.lock

Lines changed: 443 additions & 178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/consensus/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl<Block: BlockT, I: Clone + BlockImport<Block>, C> Clone for FrontierBlockImp
8080
impl<B, I, C> FrontierBlockImport<B, I, C>
8181
where
8282
B: BlockT,
83-
I: BlockImport<B, Transaction = sp_api::TransactionFor<C, B>>,
83+
I: BlockImport<B>,
8484
I::Error: Into<ConsensusError>,
8585
C: ProvideRuntimeApi<B>,
8686
C::Api: BlockBuilderApi<B> + EthereumRuntimeRPCApi<B>,
@@ -98,13 +98,12 @@ where
9898
impl<B, I, C> BlockImport<B> for FrontierBlockImport<B, I, C>
9999
where
100100
B: BlockT,
101-
I: BlockImport<B, Transaction = sp_api::TransactionFor<C, B>> + Send + Sync,
101+
I: BlockImport<B> + Send + Sync,
102102
I::Error: Into<ConsensusError>,
103103
C: ProvideRuntimeApi<B> + Send + Sync,
104104
C::Api: BlockBuilderApi<B> + EthereumRuntimeRPCApi<B>,
105105
{
106106
type Error = ConsensusError;
107-
type Transaction = sp_api::TransactionFor<C, B>;
108107

109108
async fn check_block(
110109
&mut self,
@@ -115,7 +114,7 @@ where
115114

116115
async fn import_block(
117116
&mut self,
118-
block: BlockImportParams<B, Self::Transaction>,
117+
block: BlockImportParams<B>,
119118
) -> Result<ImportResult, Self::Error> {
120119
// We validate that there are only one frontier log. No other
121120
// actions are needed and mapping syncing is delegated to a separate

client/rpc/src/eth/execute.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ use scale_codec::{Decode, Encode};
2626
use sc_client_api::backend::{Backend, StorageProvider};
2727
use sc_transaction_pool::ChainApi;
2828
use sp_api::{
29-
ApiExt, CallApiAt, CallApiAtParams, CallContext, Extensions, ProvideRuntimeApi,
30-
StorageTransactionCache,
29+
ApiExt, CallApiAt, CallApiAtParams, Extensions, ProvideRuntimeApi,
3130
};
3231
use sp_block_builder::BlockBuilder as BlockBuilderApi;
3332
use sp_blockchain::HeaderBackend;
33+
use sp_core::traits::CallContext;
3434
use sp_io::hashing::{blake2_128, twox_128};
35-
use sp_runtime::{traits::Block as BlockT, DispatchError, SaturatedConversion};
35+
use sp_runtime::{
36+
traits::{Block as BlockT, HashingFor},
37+
DispatchError, SaturatedConversion,
38+
};
3639
use sp_state_machine::OverlayedChanges;
3740
// Frontier
3841
use fc_rpc_core::types::*;
@@ -237,14 +240,11 @@ where
237240
api_version,
238241
state_overrides,
239242
)?;
240-
let storage_transaction_cache =
241-
RefCell::<StorageTransactionCache<B, C::StateBackend>>::default();
242243
let params = CallApiAtParams {
243244
at: substrate_hash,
244245
function: "EthereumRuntimeRPCApi_call",
245246
arguments: encoded_params,
246247
overlayed_changes: &RefCell::new(overlayed_changes),
247-
storage_transaction_cache: &storage_transaction_cache,
248248
call_context: CallContext::Offchain,
249249
recorder: &None,
250250
extensions: &RefCell::new(Extensions::new()),
@@ -884,7 +884,7 @@ where
884884
block_hash: B::Hash,
885885
api_version: u32,
886886
state_overrides: Option<BTreeMap<H160, CallStateOverride>>,
887-
) -> RpcResult<OverlayedChanges> {
887+
) -> RpcResult<OverlayedChanges<HashingFor<B>>> {
888888
let mut overlayed_changes = OverlayedChanges::default();
889889
if let Some(state_overrides) = state_overrides {
890890
for (address, state_override) in state_overrides {

client/rpc/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub mod frontier_backend_client {
6969
use sp_io::hashing::{blake2_128, twox_128};
7070
use sp_runtime::{
7171
generic::BlockId,
72-
traits::{Block as BlockT, UniqueSaturatedInto, Zero},
72+
traits::{Block as BlockT, HashingFor, UniqueSaturatedInto, Zero},
7373
};
7474
use sp_state_machine::OverlayedChanges;
7575
// Frontier
@@ -92,7 +92,7 @@ pub mod frontier_backend_client {
9292

9393
fn set_overlayed_changes(
9494
client: &C,
95-
overlayed_changes: &mut OverlayedChanges,
95+
overlayed_changes: &mut OverlayedChanges<HashingFor<B>>,
9696
block: B::Hash,
9797
_version: u32,
9898
address: H160,
@@ -145,7 +145,7 @@ pub mod frontier_backend_client {
145145

146146
fn set_overlayed_changes(
147147
client: &C,
148-
overlayed_changes: &mut OverlayedChanges,
148+
overlayed_changes: &mut OverlayedChanges<HashingFor<B>>,
149149
block: B::Hash,
150150
_version: u32,
151151
address: H160,

frame/dynamic-fee/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ pub mod pallet {
9292
pub _marker: PhantomData<T>,
9393
}
9494

95+
// TODO: Just for following macro
96+
use sp_runtime as _;
9597
#[pallet::genesis_build]
9698
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
9799
fn build(&self) {

frame/ethereum/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ use fp_evm::{
3939
};
4040
use fp_storage::{EthereumStorageSchema, PALLET_ETHEREUM_SCHEMA};
4141
use frame_support::{
42-
codec::{Decode, Encode, MaxEncodedLen},
4342
dispatch::{
4443
DispatchErrorWithPostInfo, DispatchInfo, DispatchResultWithPostInfo, Pays, PostDispatchInfo,
4544
},
46-
scale_info::TypeInfo,
4745
traits::{EnsureOrigin, Get, PalletInfoAccess, Time},
4846
weights::Weight,
4947
};
5048
use frame_system::{pallet_prelude::OriginFor, CheckWeight, WeightInfo};
5149
use pallet_evm::{BlockHashMapping, FeeCalculator, GasWeightMapping, Runner};
50+
use scale_codec::{Decode, Encode, MaxEncodedLen};
51+
use scale_info::TypeInfo;
5252
use sp_runtime::{
5353
generic::DigestItem,
5454
traits::{DispatchInfoOf, Dispatchable, One, Saturating, UniqueSaturatedInto, Zero},

frame/evm-chain-id/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ pub mod pallet {
6161
pub _marker: PhantomData<T>,
6262
}
6363

64+
// TODO: Just for following macro
65+
use sp_runtime as _;
6466
#[pallet::genesis_build]
6567
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
6668
fn build(&self) {

frame/evm/precompile/dispatch/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ edition = { workspace = true }
88
repository = { workspace = true }
99

1010
[dependencies]
11+
scale-codec = { package = "parity-scale-codec", workspace = true }
1112
# Substrate
1213
frame-support = { workspace = true }
1314
# Frontier
1415
fp-evm = { workspace = true }
1516
pallet-evm = { workspace = true }
1617

1718
[dev-dependencies]
18-
scale-codec = { package = "parity-scale-codec", workspace = true }
1919
scale-info = { workspace = true }
2020
# Substrate
2121
frame-system = { workspace = true, features = ["default"] }

frame/evm/precompile/dispatch/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ use fp_evm::{
3333
PrecompileResult,
3434
};
3535
use frame_support::{
36-
codec::{Decode, DecodeLimit as _},
3736
dispatch::{DispatchClass, Dispatchable, GetDispatchInfo, Pays, PostDispatchInfo},
3837
traits::{ConstU32, Get},
3938
};
4039
use pallet_evm::{AddressMapping, GasWeightMapping};
40+
use scale_codec::{Decode, DecodeLimit as _};
4141

4242
// `DecodeLimit` specifies the max depth a call can use when decoding, as unbounded depth
4343
// can be used to overflow the stack.

frame/evm/src/benchmarking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ benchmarks! {
3333

3434
let x in 1..10000000;
3535

36-
use frame_benchmarking::vec;
36+
use sp_std::vec;
3737
use rlp::RlpStream;
3838
use sp_core::{H160, U256};
3939

0 commit comments

Comments
 (0)