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

Support for Frame Metadata Hash - Ledger Integration #969

Merged
merged 6 commits into from
Jul 2, 2024
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
81 changes: 42 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ orml-vesting = { git = "https://github.com/Polkadex-Substrate/orml-1.1.0.git", b
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
Expand Down Expand Up @@ -210,6 +210,7 @@ pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk"
polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }

[patch.'https://github.com/w3f/ring-vrf']
bandersnatch_vrfs = { git = "https://github.com/w3f//ring-vrf.git", rev = "3ebdd261873da05124f4499c85a8e62d40411620"}
1 change: 1 addition & 0 deletions nodes/mainnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ substrate-build-script-utils = { version = "5.0.0" }
structopt = { version = "0.3.8", optional = true }

[dependencies]
frame-metadata-hash-extension = { workspace = true }
# third-party dependencies
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.136", features = ["derive"] }
Expand Down
3 changes: 3 additions & 0 deletions nodes/mainnet/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub fn create_extrinsic(
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::<
node_polkadex_runtime::Runtime,
>::from(tip, None),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
);

let raw_payload = node_polkadex_runtime::SignedPayload::from_raw(
Expand All @@ -121,6 +122,7 @@ pub fn create_extrinsic(
(),
(),
(),
None,
),
);
let signature = raw_payload.using_encoded(|e| sender.sign(e));
Expand Down Expand Up @@ -312,6 +314,7 @@ pub fn new_partial(
}

/// Result of [`new_full_base`].
#[allow(dead_code)]
pub struct NewFullBase {
/// The task manager of the node.
pub task_manager: TaskManager,
Expand Down
6 changes: 1 addition & 5 deletions pallets/ocex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,11 +970,7 @@ pub mod pallet {
claim_safety_period: Option<u32>,
) -> DispatchResult {
T::GovernanceOrigin::ensure_origin(origin)?;
let mut config = if let Some(config) = <ExpectedLMPConfig<T>>::get() {
config
} else {
LMPEpochConfig::default()
};
let mut config = <ExpectedLMPConfig<T>>::get().unwrap_or_default();
let unit: Decimal = Decimal::from(UNIT_BALANCE);
if let Some(total_liquidity_mining_rewards) = total_liquidity_mining_rewards {
config.total_liquidity_mining_rewards =
Expand Down
5 changes: 2 additions & 3 deletions pallets/ocex/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ impl<T: Config> Pallet<T> {
let authorities = Self::validator_set().validators;
let mut available_keys = authorities
.iter()
.enumerate()
.filter_map(move |(_index, authority)| {
.filter_map(move |authority| {
local_keys
.binary_search(authority)
.ok()
Expand Down Expand Up @@ -671,7 +670,7 @@ impl<T: Config> Pallet<T> {
fn start_new_lmp_epoch(state: &mut OffchainState, epoch: u16) -> Result<(), &'static str> {
let mut config = if epoch > 1 {
get_lmp_config(state, epoch)
.unwrap_or_else(|_| orderbook_primitives::lmp::LMPConfig { epoch, index: 0 })
.unwrap_or(orderbook_primitives::lmp::LMPConfig { epoch, index: 0 })
} else {
// To Handle the corner case of zero
orderbook_primitives::lmp::LMPConfig { epoch, index: 0 }
Expand Down
Loading
Loading