-
Notifications
You must be signed in to change notification settings - Fork 335
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
chore: Let PocketIC library depend on public ic-management-canister-types #3986
base: master
Are you sure you want to change the base?
Conversation
fn candid_equality_test() { | ||
let declared_interface_str = | ||
std::fs::read_to_string(std::env::var_os("IC_DID").unwrap()).unwrap(); | ||
let declared_interface = CandidSource::Text(&declared_interface_str); | ||
|
||
candid::export_service!(); | ||
let implemented_interface_str = __export_service(); | ||
let implemented_interface = CandidSource::Text(&implemented_interface_str); | ||
|
||
let result = service_equal(declared_interface, implemented_interface); | ||
assert!(result.is_ok(), "{:?}\n\n", result.unwrap_err()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have this test somewhere?
/// Types of curves that can be used for threshold key derivation (vetKD). | ||
/// ```text | ||
/// (variant { bls12_381_g2; }) | ||
/// ``` | ||
#[derive( | ||
Copy, | ||
Clone, | ||
Eq, | ||
PartialEq, | ||
Ord, | ||
PartialOrd, | ||
Hash, | ||
Debug, | ||
CandidType, | ||
Deserialize, | ||
EnumIter, | ||
Serialize, | ||
)] | ||
pub enum VetKdCurve { | ||
#[serde(rename = "bls12_381_g2")] | ||
#[allow(non_camel_case_types)] | ||
Bls12_381_G2, | ||
} | ||
|
||
/// Unique identifier for a key that can be used for threshold key derivation | ||
/// (vetKD). The name is just an identifier, but it may be used to convey | ||
/// some information about the key (e.g. that the key is meant to be used for | ||
/// testing purposes). | ||
/// ```text | ||
/// (record { curve: vetkd_curve; name: text}) | ||
/// ``` | ||
#[derive( | ||
Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, CandidType, Deserialize, Serialize, | ||
)] | ||
pub struct VetKdKeyId { | ||
pub curve: VetKdCurve, | ||
pub name: String, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not publicly released yet (dfinity/portal#3763)
pub enum MasterPublicKeyId { | ||
Ecdsa(EcdsaKeyId), | ||
Schnorr(SchnorrKeyId), | ||
VetKd(VetKdKeyId), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
who uses that?
This is an imperfect step in the right direction.
Follow-ups and explanations:
management_canister
module are different from the ones in the public crate. For now, they are importedas
their old name, in order to reduce changes in this PR. They should probably be consistently renamed. Depending on whether these types are exposed to PocketIC users, this might be a breaking change, hence this PR does not perform this renaming step.management_canister
still contains a few types, because they are not defined YET in the current version of the public crate, or they are more recent versions of those types (e.g., with an additional field). As the public crate is upgraded and contains all necessary types, this module will hopefully disappear, and all necessary management canister types can be imported via the public crate. For experimental pre-releases, theic-management-canister-types
crate and thepocket-ic
crate have to both publish beta-releases on crates.io.This PR changes more crates in
ic/rs/...
than it should, becauseas
the old name.To the codeowners of these crates:
If you have only imported PocketIC for the management canister types, please remove the dependency and depend on the public crate. If you find yourself depending on ic-management-canister-types-private or
"//rs/types/management_canister_types"
, please also move to the public crate.