Skip to content

Commit

Permalink
fix rest of compilation errors
Browse files Browse the repository at this point in the history
Signed-off-by: georgepisaltu <[email protected]>
  • Loading branch information
georgepisaltu committed May 10, 2024
1 parent 8604120 commit 26e9569
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ macro_rules! generate_bridge_reject_obsolete_headers_and_messages {
<$call as sp_runtime::traits::Dispatchable>::RuntimeOrigin,
), sp_runtime::transaction_validity::TransactionValidityError
> {
use sp_runtime::traits::AsSystemOriginSigner;
let tx_validity = sp_runtime::transaction_validity::ValidTransaction::default();
let who = origin.as_system_origin_signer().ok_or(sp_runtime::transaction_validity::InvalidTransaction::BadSigner)?;
$(
Expand All @@ -317,6 +318,7 @@ macro_rules! generate_bridge_reject_obsolete_headers_and_messages {
_context: &Context,
) -> Result<Self::Pre, sp_runtime::transaction_validity::TransactionValidityError> {
use tuplex::PushBack;
use sp_runtime::traits::AsSystemOriginSigner;
let to_post_dispatch = ();
let relayer = origin.as_system_origin_signer().ok_or(sp_runtime::transaction_validity::InvalidTransaction::BadSigner)?;
$(
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use frame_support::{
use pallet_transaction_payment::Multiplier;
use sp_runtime::{
testing::H256,
traits::{AsSystemOriginSigner, BlakeTwo256, ConstU32, ConstU64, ConstU8},
traits::{BlakeTwo256, ConstU32, ConstU64, ConstU8},
FixedPointNumber, Perquintill,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn construct_extrinsic_westend(
type Runtime = <Westend as Chain>::Runtime;
let account_id = <Runtime as frame_system::Config>::AccountId::from(sender.public());
let tip = 0;
let extra: westend_runtime::SignedExtra = (
let tx_ext: westend_runtime::TxExtension = (
frame_system::CheckNonZeroSender::<Runtime>::new(),
frame_system::CheckSpecVersion::<Runtime>::new(),
frame_system::CheckTxVersion::<Runtime>::new(),
Expand All @@ -325,14 +325,14 @@ fn construct_extrinsic_westend(
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
);
let raw_payload = westend_runtime::SignedPayload::new(call, extra).unwrap();
let raw_payload = westend_runtime::SignedPayload::new(call, tx_ext).unwrap();
let signature = raw_payload.using_encoded(|payload| sender.sign(payload));
let (call, extra, _) = raw_payload.deconstruct();
let (call, tx_ext, _) = raw_payload.deconstruct();
westend_runtime::UncheckedExtrinsic::new_signed(
call,
account_id.into(),
MultiSignature::Sr25519(signature),
extra,
tx_ext,
)
}

Expand All @@ -344,7 +344,7 @@ fn construct_extrinsic_penpal(
type Runtime = <PenpalA as Chain>::Runtime;
let account_id = <Runtime as frame_system::Config>::AccountId::from(sender.public());
let tip = 0;
let extra: penpal_runtime::SignedExtra = (
let tx_ext: penpal_runtime::TxExtension = (
frame_system::CheckNonZeroSender::<Runtime>::new(),
frame_system::CheckSpecVersion::<Runtime>::new(),
frame_system::CheckTxVersion::<Runtime>::new(),
Expand All @@ -357,14 +357,14 @@ fn construct_extrinsic_penpal(
pallet_asset_tx_payment::ChargeAssetTxPayment::<Runtime>::from(tip, None),
);
type SignedPayload =
generic::SignedPayload<penpal_runtime::RuntimeCall, penpal_runtime::SignedExtra>;
let raw_payload = SignedPayload::new(call, extra).unwrap();
generic::SignedPayload<penpal_runtime::RuntimeCall, penpal_runtime::TxExtension>;
let raw_payload = SignedPayload::new(call, tx_ext).unwrap();
let signature = raw_payload.using_encoded(|payload| sender.sign(payload));
let (call, extra, _) = raw_payload.deconstruct();
let (call, tx_ext, _) = raw_payload.deconstruct();
penpal_runtime::UncheckedExtrinsic::new_signed(
call,
account_id.into(),
MultiSignature::Sr25519(signature),
extra,
tx_ext,
)
}
4 changes: 2 additions & 2 deletions substrate/frame/examples/tasks/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

use crate::{self as tasks_example};
use frame_support::derive_impl;
use sp_runtime::testing::TestXt;
use sp_runtime::generic::UncheckedExtrinsic;

pub type AccountId = u32;
pub type Balance = u32;
Expand All @@ -33,7 +33,7 @@ frame_support::construct_runtime!(
}
);

pub type Extrinsic = TestXt<RuntimeCall, ()>;
pub type Extrinsic = UncheckedExtrinsic<u64, RuntimeCall, (), ()>;

#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
Expand Down
6 changes: 6 additions & 0 deletions substrate/frame/executive/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ impl pallet_balances::WeightInfo for BalancesWeights {
fn force_adjust_total_issuance() -> Weight {
Weight::zero()
}
fn burn_allow_death() -> Weight {
Weight::zero()
}
fn burn_keep_alive() -> Weight {
Weight::zero()
}
}

#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ use crate as pallet_skip_feeless_payment;

use frame_support::{derive_impl, parameter_types};
use frame_system as system;
use sp_runtime::traits::{OriginOf, TransactionExtension};
use sp_runtime::{
traits::{OriginOf, TransactionExtension},
transaction_validity::ValidTransaction,
};

type Block = frame_system::mocking::MockBlock<Runtime>;

Expand Down
1 change: 1 addition & 0 deletions templates/parachain/runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl pallet_transaction_payment::Config for Runtime {
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightInfo = ();
}

impl pallet_sudo::Config for Runtime {
Expand Down

0 comments on commit 26e9569

Please sign in to comment.