diff --git a/Cargo.lock b/Cargo.lock index c2dd17b83..277d650ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5393,6 +5393,7 @@ dependencies = [ "frame-election-provider-support", "frame-support", "frame-system", + "hex", "itertools 0.13.0", "log", "pallet-balances", diff --git a/Cargo.toml b/Cargo.toml index 3c6f0a53e..95bd4e0f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ chrono = { version = "0.4.31", default-features = false } clap = { version = "4.2.5", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] } futures = { version = "0.3.21" } +hex = { version = "0.4.3", default-features = false, features = ["alloc"] } hex-literal = { version = "^0.3.1", default-features = false } jsonrpsee = { version = "0.16.2", default-features = false, features = ["server"] } lazy_static = { version = "1.4.0", default-features = false } diff --git a/pallets/ddc-verification/Cargo.toml b/pallets/ddc-verification/Cargo.toml index fc97bc559..514802392 100644 --- a/pallets/ddc-verification/Cargo.toml +++ b/pallets/ddc-verification/Cargo.toml @@ -19,6 +19,7 @@ frame-benchmarking = { workspace = true, optional = true } frame-election-provider-support = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } +hex = { workspace = true } itertools = { workspace = true } log = { workspace = true } polkadot-ckb-merkle-mountain-range = { workspace = true } @@ -44,6 +45,7 @@ sp-keystore = { workspace = true } [features] default = ["std"] std = [ + "hex/std", "polkadot-ckb-merkle-mountain-range/std", "codec/std", "frame-benchmarking?/std", diff --git a/pallets/ddc-verification/src/lib.rs b/pallets/ddc-verification/src/lib.rs index e09cd51d3..d3f6be656 100644 --- a/pallets/ddc-verification/src/lib.rs +++ b/pallets/ddc-verification/src/lib.rs @@ -1431,9 +1431,11 @@ pub mod pallet { payers: customers_activity_batched[i] .iter() .map(|activity| { - let customer_id = activity.clone().customer_id.into_bytes(); - let account_id = - T::AccountId::decode(&mut &customer_id[..]).unwrap(); // todo! Remove Unwrap + let binding = activity.clone(); + let customer_id = binding.customer_id.as_str(); + let key = customer_id.trim_start_matches("0x"); + let h_key = hex::decode(key).unwrap(); + let account_id = T::AccountId::decode(&mut &h_key[..]).unwrap(); // todo! Remove Unwrap let customer_usage = CustomerUsage { transferred_bytes: activity.transferred_bytes, stored_bytes: activity.stored_bytes, diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index 78b7a4015..41251e123 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -146,7 +146,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 54108, + spec_version: 54109, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 19,