Skip to content

Commit

Permalink
add version
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Jul 31, 2024
1 parent fd156d3 commit 48af94f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pythnet/pythnet_sdk/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,12 @@ impl Arbitrary for TwapMessage {
}
}

pub const PUBLISHER_STAKE_CAPS_MESSAGE_VERSION: u8 = 1;

#[repr(C)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PublisherStakeCapsMessage {
pub version: u8,
pub publish_time: i64,
pub caps: PrefixedVec<u16, PublisherStakeCap>, // PrefixedVec because we might have more than 256 publishers
}
Expand All @@ -202,6 +205,7 @@ impl Arbitrary for PublisherStakeCapsMessage {
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
let caps = Vec::arbitrary(g);
PublisherStakeCapsMessage {
version: PUBLISHER_STAKE_CAPS_MESSAGE_VERSION,
publish_time: i64::arbitrary(g),
caps: caps.into(),
}
Expand Down

0 comments on commit 48af94f

Please sign in to comment.