Rename uid to intent

This commit is contained in:
Luke Parker
2023-05-08 22:21:41 -04:00
parent 964fdee175
commit 219adc7657

View File

@@ -219,14 +219,14 @@ const TYPE_COORDINATOR_UID: u8 = 4;
const TYPE_SUBSTRATE_UID: u8 = 5; const TYPE_SUBSTRATE_UID: u8 = 5;
impl CoordinatorMessage { impl CoordinatorMessage {
/// A unique ID for this message, which should be unique across the validator's entire system, /// The intent for this message, which should be unique across the validator's entire system,
/// including all of its processors. /// including all of its processors.
/// ///
/// This doesn't use H(msg.serialize()) as it's meant to be unique to intent, not unique to /// This doesn't use H(msg.serialize()) as it's meant to be unique to intent, not unique to
/// values. While the values should be consistent per intent, that assumption isn't required /// values. While the values should be consistent per intent, that assumption isn't required
/// here. /// here.
// TODO: Should this use borsh intead of bincode? // TODO: Should this use borsh intead of bincode?
pub fn uid(&self) -> Vec<u8> { pub fn intent(&self) -> Vec<u8> {
match self { match self {
CoordinatorMessage::KeyGen(msg) => { CoordinatorMessage::KeyGen(msg) => {
// Unique since key gen ID embeds the validator set and attempt // Unique since key gen ID embeds the validator set and attempt
@@ -293,13 +293,13 @@ impl CoordinatorMessage {
} }
impl ProcessorMessage { impl ProcessorMessage {
/// A unique ID for this message, which should be unique across the validator's entire system, /// The intent for this message, which should be unique across the validator's entire system,
/// including all of its processors. /// including all of its processors.
/// ///
/// This doesn't use H(msg.serialize()) as it's meant to be unique to intent, not unique to /// This doesn't use H(msg.serialize()) as it's meant to be unique to intent, not unique to
/// values. While the values should be consistent per intent, that assumption isn't required /// values. While the values should be consistent per intent, that assumption isn't required
/// here. /// here.
pub fn uid(&self) -> Vec<u8> { pub fn intent(&self) -> Vec<u8> {
match self { match self {
ProcessorMessage::KeyGen(msg) => { ProcessorMessage::KeyGen(msg) => {
let (sub, id) = match msg { let (sub, id) = match msg {