Skip to content

Commit

Permalink
Try fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
boundless-forest committed Nov 7, 2023
1 parent 8fd0988 commit 83f9761
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pallet-moonbeam-orbiters = { path = "pallets/moonbeam-orbiters",
pallet-parachain-staking = { path = "pallets/parachain-staking", default-features = false }
pallet-proxy-genesis-companion = { path = "pallets/proxy-genesis-companion", default-features = false }
pallet-xcm-transactor = { path = "pallets/xcm-transactor", default-features = false }
precompile-utils = { path = "precompiles/utils", default-features = false }
precompile-utils = { path = "/home/bear/coding/rust-space/frontier/precompiles", default-features = false }
xcm-primitives = { path = "primitives/xcm", default-features = false }

pallet-crowdloan-rewards = { git = "https://github.com/moonbeam-foundation/crowdloan-rewards", branch = "moonbeam-polkadot-v1.1.0", default-features = false }
Expand Down Expand Up @@ -246,6 +246,7 @@ pallet-evm-precompile-simple = { git = "https://github.com/paritytech/frontier",
# Frontier (client)
fc-consensus = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0" }
fc-db = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0" }
fc-api = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0" }
fc-mapping-sync = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0" }
fc-rpc = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0", features = [
"rpc-binary-search-estimate",
Expand Down
1 change: 1 addition & 0 deletions client/rpc/debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ fc-db = { workspace = true }
fc-rpc = { workspace = true, features = [ "rpc-binary-search-estimate" ] }
fc-storage = { workspace = true }
fp-rpc = { workspace = true, features = [ "std" ] }
fc-api = { workspace = true }
6 changes: 3 additions & 3 deletions client/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ where
pub fn task(
client: Arc<C>,
backend: Arc<BE>,
frontier_backend: Arc<dyn fc_db::BackendReader<B> + Send + Sync>,
frontier_backend: Arc<dyn fc_api::Backend<B> + Send + Sync>,
permit_pool: Arc<Semaphore>,
overrides: Arc<OverrideHandle<B>>,
raw_max_memory_usage: usize,
Expand Down Expand Up @@ -282,7 +282,7 @@ where
fn handle_block_request(
client: Arc<C>,
backend: Arc<BE>,
frontier_backend: Arc<dyn fc_db::BackendReader<B> + Send + Sync>,
frontier_backend: Arc<dyn fc_api::Backend<B> + Send + Sync>,
request_block_id: RequestBlockId,
params: Option<TraceParams>,
overrides: Arc<OverrideHandle<B>>,
Expand Down Expand Up @@ -417,7 +417,7 @@ where
fn handle_transaction_request(
client: Arc<C>,
backend: Arc<BE>,
frontier_backend: Arc<dyn fc_db::BackendReader<B> + Send + Sync>,
frontier_backend: Arc<dyn fc_api::Backend<B> + Send + Sync>,
transaction_hash: H256,
params: Option<TraceParams>,
overrides: Arc<OverrideHandle<B>>,
Expand Down
6 changes: 3 additions & 3 deletions pallets/ethereum-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod tests;

use ethereum_types::{H160, U256};
use fp_ethereum::{TransactionData, ValidatedTransaction};
use fp_evm::{CheckEvmTransaction, CheckEvmTransactionConfig, InvalidEvmTransactionError};
use fp_evm::{CheckEvmTransaction, CheckEvmTransactionConfig, TransactionValidationError};
use frame_support::{
dispatch::{DispatchResultWithPostInfo, Pays, PostDispatchInfo},
traits::{EnsureOrigin, Get},
Expand Down Expand Up @@ -93,7 +93,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config + pallet_timestamp::Config + pallet_evm::Config {
/// Invalid transaction error
type InvalidEvmTransactionError: From<InvalidEvmTransactionError>;
type InvalidEvmTransactionError: From<TransactionValidationError>;
/// Handler for applying an already validated transaction
type ValidatedTransaction: ValidatedTransaction;
/// Origin for xcm transact
Expand Down Expand Up @@ -300,7 +300,7 @@ impl<T: Config> Pallet<T> {
// transaction on chain - we increase the global nonce.
<Nonce<T>>::put(current_nonce.saturating_add(U256::one()));

T::ValidatedTransaction::apply(source, transaction)
T::ValidatedTransaction::apply(source, transaction).map(|(post_info, _)| post_info)
} else {
Err(sp_runtime::DispatchErrorWithPostInfo {
post_info: PostDispatchInfo {
Expand Down
14 changes: 7 additions & 7 deletions precompiles/conviction-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ precompile-utils = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-conviction-voting = { workspace = true }
parity-scale-codec = { workspace = true, features = [ "derive" ] }
parity-scale-codec = { workspace = true, features = ["derive"] }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

# Frontier
fp-evm = { workspace = true }
pallet-evm = { workspace = true, features = [ "forbid-evm-reentrancy" ] }
pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }

[dev-dependencies]
derive_more = { workspace = true }
Expand All @@ -33,16 +33,16 @@ serde = { workspace = true }
sha3 = { workspace = true }

# Moonbeam
precompile-utils = { workspace = true, features = [ "testing" ] }
precompile-utils = { workspace = true, features = ["testing"] }

# Substrate
pallet-balances = { workspace = true, features = [ "insecure_zero_ed", "std" ] }
pallet-timestamp = { workspace = true, features = [ "std" ] }
scale-info = { workspace = true, features = [ "derive", "std" ] }
pallet-balances = { workspace = true, features = ["insecure_zero_ed", "std"] }
pallet-timestamp = { workspace = true, features = ["std"] }
scale-info = { workspace = true, features = ["derive", "std"] }
sp-io = { workspace = true }

[features]
default = [ "std" ]
default = ["std"]
std = [
"fp-evm/std",
"frame-support/std",
Expand Down
13 changes: 6 additions & 7 deletions precompiles/conviction-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ where
let origin = Runtime::AddressMapping::into_account_id(caller);
let call = ConvictionVotingCall::<Runtime>::vote { poll_index, vote }.into();

<RuntimeHelper<Runtime>>::try_dispatch(handle, Some(origin).into(), call, 0)?;
<RuntimeHelper<Runtime>>::try_dispatch(handle, Some(origin).into(), call)?;

event.record(handle)?;

Expand Down Expand Up @@ -288,7 +288,7 @@ where
let origin = Runtime::AddressMapping::into_account_id(caller);
let call = ConvictionVotingCall::<Runtime>::remove_vote { class, index };

RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call, 0)?;
RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call)?;

event.record(handle)?;

Expand Down Expand Up @@ -332,7 +332,7 @@ where
index,
};

RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call, 0)?;
RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call)?;

event.record(handle)?;

Expand Down Expand Up @@ -380,8 +380,7 @@ where
RuntimeHelper::<Runtime>::try_dispatch(
handle,
Some(origin).into(),
call,
SYSTEM_ACCOUNT_SIZE,
call
)?;

event.record(handle)?;
Expand All @@ -405,7 +404,7 @@ where
let origin = Runtime::AddressMapping::into_account_id(caller);
let call = ConvictionVotingCall::<Runtime>::undelegate { class };

RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call, 0)?;
RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call)?;

event.record(handle)?;

Expand Down Expand Up @@ -437,7 +436,7 @@ where
let origin = Runtime::AddressMapping::into_account_id(handle.context().caller);
let call = ConvictionVotingCall::<Runtime>::unlock { class, target };

RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call, 0)?;
RuntimeHelper::<Runtime>::try_dispatch(handle, Some(origin).into(), call)?;

event.record(handle)?;

Expand Down

0 comments on commit 83f9761

Please sign in to comment.