Skip to content

Commit 728f8f5

Browse files
Developed identity_verifier pallet migration to make more general purpose. Developed the proxy pallet verifier migration to verify all delegates. Developed system pallet verifier migration to properly set the log target.
1 parent fc63e2a commit 728f8f5

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

runtime/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ impl_opaque_keys! {
225225

226226
#[sp_version::runtime_version]
227227
pub const VERSION: RuntimeVersion = RuntimeVersion {
228-
spec_name: create_runtime_str!("luhn"),
229-
impl_name: create_runtime_str!("luhn"),
228+
// spec_name: create_runtime_str!("luhn"), //for the mainnetwork it can not be changed
229+
// impl_name: create_runtime_str!("luhn"),
230+
spec_name: create_runtime_str!("hashed"), // for md5 rococo
231+
impl_name: create_runtime_str!("hashed"),
230232
authoring_version: 3,
231233
spec_version: 3,
232234
impl_version: 3,

runtime/src/migrations/identity_verifier.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ impl OnRuntimeUpgrade for Migrate {
8585
log::info!("twitter: {:?}", v.info.twitter);
8686
});
8787

88-
let identity = IdentityOf::<Runtime>::get(TestAccount::get()).unwrap();
89-
log::info!("display identity: {:?}", identity.info.display);
88+
// let identity = IdentityOf::<Runtime>::get(TestAccount::get()).unwrap();
89+
// log::info!("display identity: {:?}", identity.info.display);
9090

9191
let registrars = Registrars::<Runtime>::get();
9292
let registrars_count = registrars.len();

runtime/src/migrations/proxy_verifier.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ impl OnRuntimeUpgrade for Migrate {
3131
log::info!(" ");
3232
log::info!(" ");
3333
log::info!("key account bytes: {:?} ", account_bytes);
34-
let delegate_bytes: [u8; 32] = v.0[0].delegate.clone().into();
35-
log::info!("delegate bytes: {:?}", delegate_bytes);
36-
log::info!("proxy_type: {:?}", v.0[0].proxy_type);
37-
log::info!("delay: {:?}", v.0[0].delay);
34+
v.0.iter().for_each(|d| {
35+
let delegate_bytes: [u8; 32] = d.delegate.clone().into();
36+
log::info!("delegate bytes: {:?}", delegate_bytes);
37+
log::info!("proxy_type: {:?}", d.proxy_type);
38+
log::info!("delay: {:?}", d.delay);
39+
});
3840
log::info!("value: {:?}", v.1);
41+
3942
});
4043
Ok(())
4144
}

runtime/src/migrations/system.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ pub mod v0 {
100100
log::info!(target: TARGET, "account keys: {}, decodable accounts: {}", num_account_keys, num_accounts);
101101
frame_system::Account::<Runtime>::iter().take(10).for_each(|(k, v)| {
102102
let account_bytes: [u8; 32] = k.clone().into();
103-
log::info!(" ");
104-
log::info!(" ");
105-
log::info!("key account bytes: {:?} ", account_bytes);
106-
log::info!("Nonce: {:?}", v.nonce);
107-
log::info!("Consumers: {:?}", v.consumers);
108-
log::info!("Providers: {:?}", v.providers);
109-
log::info!("Sufficients: {:?}", v.sufficients);
110-
log::info!("Data: {:?}", v.data);
103+
log::info!(target: TARGET, " ");
104+
log::info!(target: TARGET, " ");
105+
log::info!(target: TARGET, "key account bytes: {:?} ", account_bytes);
106+
log::info!(target: TARGET, "Nonce: {:?}", v.nonce);
107+
log::info!(target: TARGET, "Consumers: {:?}", v.consumers);
108+
log::info!(target: TARGET, "Providers: {:?}", v.providers);
109+
log::info!(target: TARGET, "Sufficients: {:?}", v.sufficients);
110+
log::info!(target: TARGET, "Data: {:?}", v.data);
111111
});
112112
log::info!(target: TARGET, "block weight: {:?}", BlockWeight::<Runtime>::get());
113113
log::info!(target: TARGET, "digest: {:?}", Digest::<Runtime>::get());

0 commit comments

Comments
 (0)