Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Polkadot 0.9.23 #812

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
473 changes: 213 additions & 260 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions crates/pink/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,11 @@ parameter_types! {
pub const MaxValueSize: u32 = 16_384;
pub const DeletionQueueDepth: u32 = 1024;
pub const DeletionWeightLimit: Weight = 500_000_000_000;
pub const MaxCodeSize: u32 = 2 * 1024 * 1024;
pub DefaultSchedule: Schedule<PinkRuntime> = {
let mut schedule = <Schedule<PinkRuntime>>::default();
schedule.limits.code_len = MaxCodeSize::get();
schedule
};
pub const MaxCodeLen: u32 = 2 * 1024 * 1024;
pub const RelaxedMaxCodeLen: u32 = 2 * 1024 * 1024;
pub const TransactionByteFee: u64 = 0;

pub DefaultSchedule: Schedule<PinkRuntime> = Default::default();
}

impl Convert<Weight, Balance> for PinkRuntime {
Expand All @@ -130,6 +128,8 @@ impl Config for PinkRuntime {
type DepositPerItem = ConstU128<0>;
type AddressGenerator = Pink;
type ContractAccessWeight = pallet_contracts::DefaultContractAccessWeight<RuntimeBlockWeights>;
type MaxCodeLen = MaxCodeLen;
type RelaxedMaxCodeLen = RelaxedMaxCodeLen;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}


Expand Down
6 changes: 3 additions & 3 deletions pallets/bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ pub mod pallet {
/// Provides an AccountId for the pallet.
/// This is used both as an origin check and deposit/withdrawal account.
pub fn account_id() -> T::AccountId {
MODULE_ID.into_account()
MODULE_ID.into_account_truncating()
}

/// Asserts if a resource is registered
Expand Down Expand Up @@ -710,7 +710,7 @@ pub mod pallet {
impl<T: Config> EnsureOrigin<T::Origin> for EnsureBridge<T> {
type Success = T::AccountId;
fn try_origin(o: T::Origin) -> Result<Self::Success, T::Origin> {
let bridge_id = MODULE_ID.into_account();
let bridge_id = MODULE_ID.into_account_truncating();
o.into().and_then(|o| match o {
system::RawOrigin::Signed(who) if who == bridge_id => Ok(bridge_id),
r => Err(T::Origin::from(r)),
Expand All @@ -719,7 +719,7 @@ pub mod pallet {

#[cfg(feature = "runtime-benchmarks")]
fn successful_origin() -> T::Origin {
let bridge_id = MODULE_ID.into_account();
let bridge_id = MODULE_ID.into_account_truncating();
T::Origin::from(system::RawOrigin::Signed(bridge_id))
}
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/bridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub const ENDOWED_BALANCE: u64 = 100_000_000;
pub const TEST_THRESHOLD: u32 = 2;

pub fn new_test_ext() -> sp_io::TestExternalities {
let bridge_id = PalletId(*b"phala/bg").into_account();
let bridge_id = PalletId(*b"phala/bg").into_account_truncating();
let mut t = frame_system::GenesisConfig::default()
.build_storage::<Test>()
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion pallets/bridge_transfer/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub const RELAYER_C: u64 = 0x4;
pub const ENDOWED_BALANCE: u64 = 100_000_000;

pub fn new_test_ext() -> sp_io::TestExternalities {
let bridge_id = PalletId(*b"phala/bg").into_account();
let bridge_id = PalletId(*b"phala/bg").into_account_truncating();
let mut t = frame_system::GenesisConfig::default()
.build_storage::<Test>()
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion pallets/kitties/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ decl_module! {
}
impl<T: Config> Module<T> {
pub fn account_id() -> T::AccountId {
PALLET_ID.into_account()
PALLET_ID.into_account_truncating()
}

fn transfer(to: T::AccountId, kitty_id: T::Hash) -> Result {
Expand Down
2 changes: 1 addition & 1 deletion pallets/phala/src/mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ pub mod pallet {
BalanceOf<T>: FixedPointConvert,
{
pub fn account_id() -> T::AccountId {
MINING_PALLETID.into_account()
MINING_PALLETID.into_account_truncating()
}

fn heartbeat_challenge() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/debug-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ async fn main() {
use sp_runtime::traits::AccountIdConversion;
let pallet_id_array: [u8; 8] = pallet_id.as_bytes().try_into().expect("Bad length");
let id = frame_support::PalletId(pallet_id_array);
let account: AccountId = id.into_account();
let account: AccountId = id.into_account_truncating();
println!("Pallet account: {}", account);
}
Cli::Rpc { url, command } => {
Expand Down
Loading