From 03eb1161cc183be7e88be3c28f5cf672cfa1881f Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 28 Jun 2023 10:46:21 -0700 Subject: [PATCH] chore: upgrade bitflags The new bitflags no longer encodes bitflags as "bits" when serializing to a human readable format, but that's fine for us. --- Cargo.lock | 5 ++++- shared/Cargo.toml | 2 +- shared/src/event/mod.rs | 4 ++-- shared/src/sys/mod.rs | 2 +- shared/src/sys/out.rs | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8bf9a1062..dfedf148a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -358,6 +358,9 @@ name = "bitflags" version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +dependencies = [ + "serde", +] [[package]] name = "bitvec" @@ -2761,7 +2764,7 @@ version = "3.3.1" dependencies = [ "anyhow", "arbitrary", - "bitflags 1.3.2", + "bitflags 2.3.3", "blake2b_simd", "bls-signatures", "cid 0.10.1", diff --git a/shared/Cargo.toml b/shared/Cargo.toml index dc668aa41..7e7929a1b 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -26,7 +26,7 @@ serde = { version = "1", default-features = false } serde_tuple = "0.5" arbitrary = { version = "1.1", optional = true, features = ["derive"] } quickcheck = { version = "1", optional = true } -bitflags = "1.3.2" +bitflags = { version = "2.3.3", features = ["serde"] } ## non-wasm dependencies; these dependencies and the respective code is ## only activated through non-default features, which the Kernel enables, but diff --git a/shared/src/event/mod.rs b/shared/src/event/mod.rs index c9c3e5dd4..a57d2097f 100644 --- a/shared/src/event/mod.rs +++ b/shared/src/event/mod.rs @@ -38,12 +38,12 @@ impl From> for ActorEvent { bitflags! { /// Flags associated with an Event entry. - #[derive(Deserialize, Serialize)] + #[derive(Deserialize, Serialize, Copy, Clone, Eq, PartialEq, Debug)] #[serde(transparent)] pub struct Flags: u64 { const FLAG_INDEXED_KEY = 0b00000001; const FLAG_INDEXED_VALUE = 0b00000010; - const FLAG_INDEXED_ALL = Self::FLAG_INDEXED_KEY.bits | Self::FLAG_INDEXED_VALUE.bits; + const FLAG_INDEXED_ALL = Self::FLAG_INDEXED_KEY.bits() | Self::FLAG_INDEXED_VALUE.bits(); } } diff --git a/shared/src/sys/mod.rs b/shared/src/sys/mod.rs index 1425e6c20..2517c0bcd 100644 --- a/shared/src/sys/mod.rs +++ b/shared/src/sys/mod.rs @@ -51,7 +51,7 @@ impl<'a> TryFrom<&'a crate::econ::TokenAmount> for TokenAmount { bitflags! { /// Flags passed to the send syscall. - #[derive(Default)] + #[derive(Default, Copy, Clone, Eq, PartialEq, Debug)] #[repr(transparent)] // note: this is 64 bits because I don't want to hate my past self, not because we need them // right now. It doesn't really cost anything anyways. diff --git a/shared/src/sys/out.rs b/shared/src/sys/out.rs index e350f425a..3b64d1fc5 100644 --- a/shared/src/sys/out.rs +++ b/shared/src/sys/out.rs @@ -66,7 +66,7 @@ pub mod vm { bitflags! { /// Invocation flags pertaining to the currently executing actor. - #[derive(Default)] + #[derive(Default, Copy, Clone, Eq, PartialEq, Debug)] #[repr(transparent)] pub struct ContextFlags: u64 { /// Invocation is in "read-only" mode. Any balance transfers, sends that would create