Skip to content

Commit

Permalink
remove wstsmessage.txid infavor of id
Browse files Browse the repository at this point in the history
  • Loading branch information
cylewitruk committed Feb 5, 2025
1 parent f3587e0 commit d22ed61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
3 changes: 1 addition & 2 deletions protobufs/stacks/signer/v1/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ message SignerMessage {

// A wsts message.
message WstsMessage {
// The transaction ID this message relates to, will be a dummy ID for DKG messages
bitcoin.BitcoinTxid txid = 1 [deprecated = true];
reserved 1;
// The wsts message
oneof inner {
// Tell signers to begin DKG by sending DKG public shares
Expand Down
28 changes: 8 additions & 20 deletions signer/src/proto/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,13 +1095,6 @@ impl From<WstsMessage> for proto::WstsMessage {
};

proto::WstsMessage {
txid: match value.id {
WstsMessageId::BitcoinTxid(txid) => {
Some(proto::BitcoinTxid::from(BitcoinTxId::from(txid)))
}
WstsMessageId::Dkg(_) => None,
WstsMessageId::RotateKey(_) => None,
},
id: Some(match value.id {
WstsMessageId::BitcoinTxid(txid) => {
wsts_message::Id::IdBitcoinTxid(proto::BitcoinTxid {
Expand Down Expand Up @@ -1155,19 +1148,14 @@ impl TryFrom<proto::WstsMessage> for WstsMessage {

#[allow(deprecated)]
Ok(WstsMessage {
id: match value.id {
Some(id) => match id {
wsts_message::Id::IdBitcoinTxid(txid) => {
WstsMessageId::BitcoinTxid(BitcoinTxId::try_from(txid)?.into())
}
wsts_message::Id::IdRotateKey(pubkey) => {
WstsMessageId::RotateKey(PublicKey::try_from(pubkey)?)
}
wsts_message::Id::IdDkg(id) => WstsMessageId::Dkg(id.into()),
},
None => WstsMessageId::BitcoinTxid(
BitcoinTxId::try_from(value.txid.required()?)?.into(),
),
id: match value.id.required()? {
wsts_message::Id::IdBitcoinTxid(txid) => {
WstsMessageId::BitcoinTxid(BitcoinTxId::try_from(txid)?.into())
}
wsts_message::Id::IdRotateKey(pubkey) => {
WstsMessageId::RotateKey(PublicKey::try_from(pubkey)?)
}
wsts_message::Id::IdDkg(id) => WstsMessageId::Dkg(id.into()),
},
inner,
})
Expand Down
4 changes: 0 additions & 4 deletions signer/src/proto/generated/stacks.signer.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ pub mod signer_message {
/// A wsts message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WstsMessage {
/// The transaction ID this message relates to, will be a dummy ID for DKG messages
#[deprecated]
#[prost(message, optional, tag = "1")]
pub txid: ::core::option::Option<super::super::super::bitcoin::BitcoinTxid>,
/// The wsts message
#[prost(oneof = "wsts_message::Inner", tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11")]
pub inner: ::core::option::Option<wsts_message::Inner>,
Expand Down

0 comments on commit d22ed61

Please sign in to comment.