|
1 | 1 | #[allow(clippy::all)]
|
2 | 2 | #[path = "../gen/registry/registry.subnet.v1.rs"]
|
3 | 3 | pub mod v1;
|
4 |
| - |
5 |
| -use crate::registry::subnet::v1::{ |
6 |
| - ChainKeyConfig as ChainKeyConfigPb, EcdsaConfig as EcdsaConfigPb, KeyConfig as KeyConfigPb, |
7 |
| -}; |
8 |
| -use crate::types::v1::{master_public_key_id, MasterPublicKeyId as MasterPublicKeyIdPb}; |
9 |
| - |
10 |
| -/// This code is part of the data migration from `EcdsaConfig` to `ChainKeyConfig`. |
11 |
| -/// |
12 |
| -/// Use this implementation to retrofit the values from an existing `EcdsaConfig` instance in places |
13 |
| -/// where we now need a `ChainKeyConfig` instance. |
14 |
| -/// |
15 |
| -/// TODO[NNS1-2986]: Remove this code. |
16 |
| -impl From<EcdsaConfigPb> for ChainKeyConfigPb { |
17 |
| - fn from(src: EcdsaConfigPb) -> Self { |
18 |
| - let EcdsaConfigPb { |
19 |
| - key_ids, |
20 |
| - quadruples_to_create_in_advance, |
21 |
| - max_queue_size, |
22 |
| - signature_request_timeout_ns, |
23 |
| - idkg_key_rotation_period_ms, |
24 |
| - } = src; |
25 |
| - |
26 |
| - let pre_signatures_to_create_in_advance = Some(quadruples_to_create_in_advance); |
27 |
| - let max_queue_size = Some(max_queue_size); |
28 |
| - |
29 |
| - let key_configs = key_ids |
30 |
| - .into_iter() |
31 |
| - .map(|key_id| { |
32 |
| - let key_id = Some(master_public_key_id::KeyId::Ecdsa(key_id)); |
33 |
| - let key_id = Some(MasterPublicKeyIdPb { key_id }); |
34 |
| - KeyConfigPb { |
35 |
| - key_id, |
36 |
| - pre_signatures_to_create_in_advance, |
37 |
| - max_queue_size, |
38 |
| - } |
39 |
| - }) |
40 |
| - .collect(); |
41 |
| - |
42 |
| - Self { |
43 |
| - key_configs, |
44 |
| - signature_request_timeout_ns, |
45 |
| - idkg_key_rotation_period_ms, |
46 |
| - } |
47 |
| - } |
48 |
| -} |
0 commit comments