From 75aac1df1b8059845a0d19ae4c8e727a1dc81dc5 Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Mon, 3 Feb 2025 09:34:31 +0100 Subject: [PATCH] Update `derive_more` and change `derivative` to `educe` --- Cargo.lock | 18 ++-- Cargo.toml | 4 +- crates/chain-config/Cargo.toml | 2 +- crates/chain-config/src/config/chain.rs | 7 +- crates/database/src/lib.rs | 26 +++-- crates/services/importer/src/importer.rs | 28 ++--- .../services/producer/src/block_producer.rs | 8 +- crates/services/txpool_v2/src/error.rs | 102 +++++++++--------- .../services/upgradable-executor/src/error.rs | 6 +- crates/storage/src/lib.rs | 6 +- crates/types/Cargo.toml | 6 +- crates/types/src/blockchain/header.rs | 11 +- 12 files changed, 112 insertions(+), 112 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19b8bb83032..57c627817ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3520,7 +3520,7 @@ dependencies = [ "anyhow", "bech32", "bytes", - "derivative", + "educe", "fuel-core-chain-config", "fuel-core-storage", "fuel-core-types 0.41.4", @@ -3546,7 +3546,7 @@ dependencies = [ "anyhow", "base64 0.22.1", "cynic", - "derive_more 0.99.18", + "derive_more 1.0.0", "eventsource-client", "fuel-core-types 0.41.4", "futures", @@ -3609,7 +3609,7 @@ name = "fuel-core-database" version = "0.41.4" dependencies = [ "anyhow", - "derive_more 0.99.18", + "derive_more 1.0.0", "fuel-core-storage", "fuel-core-trace", "fuel-core-types 0.41.4", @@ -3701,7 +3701,7 @@ name = "fuel-core-importer" version = "0.41.4" dependencies = [ "anyhow", - "derive_more 0.99.18", + "derive_more 1.0.0", "fuel-core-metrics", "fuel-core-storage", "fuel-core-trace", @@ -3822,7 +3822,7 @@ version = "0.41.4" dependencies = [ "anyhow", "async-trait", - "derive_more 0.99.18", + "derive_more 1.0.0", "fuel-core-producer", "fuel-core-storage", "fuel-core-trace", @@ -3914,7 +3914,7 @@ name = "fuel-core-storage" version = "0.41.4" dependencies = [ "anyhow", - "derive_more 0.99.18", + "derive_more 1.0.0", "enum-iterator", "fuel-core-storage", "fuel-core-types 0.41.4", @@ -4018,7 +4018,7 @@ version = "0.41.4" dependencies = [ "anyhow", "async-trait", - "derive_more 0.99.18", + "derive_more 1.0.0", "fuel-core-metrics", "fuel-core-services", "fuel-core-storage", @@ -4062,8 +4062,8 @@ dependencies = [ "aws-config", "aws-sdk-kms", "bs58", - "derivative", "derive_more 0.99.18", + "educe", "fuel-vm 0.59.1", "k256", "rand", @@ -4079,7 +4079,7 @@ name = "fuel-core-upgradable-executor" version = "0.41.4" dependencies = [ "anyhow", - "derive_more 0.99.18", + "derive_more 1.0.0", "fuel-core-executor", "fuel-core-storage", "fuel-core-types 0.41.4", diff --git a/Cargo.toml b/Cargo.toml index 01829e0ace5..c843eca4e9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,8 +103,8 @@ async-trait = "0.1" aws-sdk-kms = "1.37" cynic = { version = "3.1.0", features = ["http-reqwest"] } clap = "4.4" -derivative = { version = "2" } -derive_more = { version = "0.99" } +educe = { version = "0.6", features = ["Eq", "PartialEq", "Hash", "Debug"] } +derive_more = { version = "1", features = ["into", "from", "display"]} enum-iterator = "1.2" hex = { version = "0.4", features = ["serde"] } hyper = { version = "0.14.26" } diff --git a/crates/chain-config/Cargo.toml b/crates/chain-config/Cargo.toml index 41a397836ad..bb3e3aa583d 100644 --- a/crates/chain-config/Cargo.toml +++ b/crates/chain-config/Cargo.toml @@ -13,7 +13,7 @@ description = "Fuel Chain config types" [dependencies] anyhow = { workspace = true } bech32 = { version = "0.9.0", default-features = false, optional = true } -derivative = { workspace = true } +educe = { workspace = true } fuel-core-storage = { workspace = true, features = ["alloc"] } fuel-core-types = { workspace = true, default-features = false, features = [ "alloc", diff --git a/crates/chain-config/src/config/chain.rs b/crates/chain-config/src/config/chain.rs index fe972bd97f7..0894ea29530 100644 --- a/crates/chain-config/src/config/chain.rs +++ b/crates/chain-config/src/config/chain.rs @@ -1,3 +1,4 @@ +use educe::Educe; use fuel_core_storage::MerkleRoot; use fuel_core_types::{ blockchain::header::StateTransitionBytecodeVersion, @@ -28,8 +29,8 @@ use crate::SnapshotMetadata; pub const LOCAL_TESTNET: &str = "local_testnet"; pub const BYTECODE_NAME: &str = "state_transition_bytecode.wasm"; -#[derive(Clone, derivative::Derivative, Deserialize, Serialize, Eq, PartialEq)] -#[derivative(Debug)] +#[derive(Clone, Educe, Deserialize, Serialize, Eq, PartialEq)] +#[educe(Debug)] pub struct ChainConfig { pub chain_name: String, pub consensus_parameters: ConsensusParameters, @@ -39,7 +40,7 @@ pub struct ChainConfig { /// Note: The state transition bytecode is stored in a separate file /// under the `BYTECODE_NAME` name in serialization form. #[serde(skip)] - #[derivative(Debug(format_with = "fmt_truncated_hex::<16>"))] + #[educe(Debug(method(fmt_truncated_hex::<16>)))] pub state_transition_bytecode: Vec, pub consensus: ConsensusConfig, } diff --git a/crates/database/src/lib.rs b/crates/database/src/lib.rs index 53d47d6eb69..f6f2e4ab613 100644 --- a/crates/database/src/lib.rs +++ b/crates/database/src/lib.rs @@ -20,12 +20,10 @@ use fuel_core_types::services::executor::Error as ExecutorError; #[allow(missing_docs)] pub enum Error { /// Error occurred during serialization or deserialization of the entity. - #[display(fmt = "error performing serialization or deserialization")] + #[display("error performing serialization or deserialization")] Codec, /// The version of database or data is invalid (possibly not migrated). - #[display( - fmt = "Invalid database version, expected {expected:#x}, found {found:#x}" - )] + #[display("Invalid database version, expected {expected:#x}, found {found:#x}")] InvalidDatabaseVersion { /// the current database version found: u32, @@ -33,17 +31,17 @@ pub enum Error { expected: u32, }, /// Multiple heights found in the commit to the database. - #[display(fmt = "Multiple heights found in the commit {heights:?}")] + #[display("Multiple heights found in the commit {heights:?}")] MultipleHeightsInCommit { /// List of heights found in the commit. heights: Vec, }, /// Failed to advance the height. - #[display(fmt = "Failed to advance the height")] + #[display("Failed to advance the height")] FailedToAdvanceHeight, /// The new and old heights are not linked. #[display( - fmt = "New and old heights are not linked: prev_height: {prev_height:#x}, new_height: {new_height:#x}" + "New and old heights are not linked: prev_height: {prev_height:#x}, new_height: {new_height:#x}" )] HeightsAreNotLinked { /// The old height. @@ -53,35 +51,35 @@ pub enum Error { }, /// The new height is not found, but the old height is set. #[display( - fmt = "The new height is not found, but the old height is set: prev_height: {prev_height:#x}" + "The new height is not found, but the old height is set: prev_height: {prev_height:#x}" )] NewHeightIsNotSet { /// The old height known by the database. prev_height: u64, }, - #[display(fmt = "The historical database doesn't have any history yet")] + #[display("The historical database doesn't have any history yet")] NoHistoryIsAvailable, #[display( - fmt = "The historical database doesn't have history for the requested height {requested_height:#x}, \ + "The historical database doesn't have history for the requested height {requested_height:#x}, \ the oldest available height is {oldest_available_height:#x}" )] NoHistoryForRequestedHeight { requested_height: u64, oldest_available_height: u64, }, - #[display(fmt = "Reached the end of the history")] + #[display("Reached the end of the history")] ReachedEndOfHistory, #[cfg(feature = "backup")] - #[display(fmt = "BackupEngine initialization error: {}", _0)] + #[display("BackupEngine initialization error: {}", _0)] BackupEngineInitError(anyhow::Error), #[cfg(feature = "backup")] - #[display(fmt = "Backup error: {}", _0)] + #[display("Backup error: {}", _0)] BackupError(anyhow::Error), #[cfg(feature = "backup")] - #[display(fmt = "Restore error: {}", _0)] + #[display("Restore error: {}", _0)] RestoreError(anyhow::Error), /// Not related to database error. diff --git a/crates/services/importer/src/importer.rs b/crates/services/importer/src/importer.rs index 4479c4efd37..047a3b45806 100644 --- a/crates/services/importer/src/importer.rs +++ b/crates/services/importer/src/importer.rs @@ -71,34 +71,34 @@ pub mod test; #[derive(Debug, derive_more::Display, derive_more::From)] pub enum Error { - #[display(fmt = "The commit is already in the progress: {_0}.")] + #[display("The commit is already in the progress: {_0}.")] SemaphoreError(TryAcquireError), + #[display("The wrong state of database during insertion of the genesis block.")] + InvalidUnderlyingDatabaseGenesisState, #[display( - fmt = "The wrong state of database during insertion of the genesis block." + "The wrong state of storage after execution of the block.\ + The actual root is {_1:?}, when the expected root is {_0:?}." )] - InvalidUnderlyingDatabaseGenesisState, - #[display(fmt = "The wrong state of storage after execution of the block.\ - The actual root is {_1:?}, when the expected root is {_0:?}.")] InvalidDatabaseStateAfterExecution(Option, Option), - #[display(fmt = "Got overflow during increasing the height.")] + #[display("Got overflow during increasing the height.")] Overflow, - #[display(fmt = "The non-generic block can't have zero height.")] + #[display("The non-generic block can't have zero height.")] ZeroNonGenericHeight, - #[display(fmt = "The actual height is {_1}, when the next expected height is {_0}.")] + #[display("The actual height is {_1}, when the next expected height is {_0}.")] IncorrectBlockHeight(BlockHeight, BlockHeight), #[display( - fmt = "Got another block id after validation of the block. Expected {_0} != Actual {_1}" + "Got another block id after validation of the block. Expected {_0} != Actual {_1}" )] BlockIdMismatch(BlockId, BlockId), - #[display(fmt = "Some of the block fields are not valid: {_0}.")] + #[display("Some of the block fields are not valid: {_0}.")] FailedVerification(anyhow::Error), - #[display(fmt = "The execution of the block failed: {_0}.")] + #[display("The execution of the block failed: {_0}.")] FailedExecution(executor::Error), - #[display(fmt = "It is not possible to execute the genesis block.")] + #[display("It is not possible to execute the genesis block.")] ExecuteGenesis, - #[display(fmt = "The database already contains the data at the height {_0}.")] + #[display("The database already contains the data at the height {_0}.")] NotUnique(BlockHeight), - #[display(fmt = "The previous block processing is not finished yet.")] + #[display("The previous block processing is not finished yet.")] PreviousBlockProcessingNotFinished, #[from] StorageError(StorageError), diff --git a/crates/services/producer/src/block_producer.rs b/crates/services/producer/src/block_producer.rs index d8dd3bcf133..e8ce7bfb043 100644 --- a/crates/services/producer/src/block_producer.rs +++ b/crates/services/producer/src/block_producer.rs @@ -62,19 +62,19 @@ pub mod gas_price; #[derive(Debug, derive_more::Display)] pub enum Error { - #[display(fmt = "Genesis block is absent")] + #[display("Genesis block is absent")] NoGenesisBlock, #[display( - fmt = "The block height {height} should be higher than the previous block height {previous_block}" + "The block height {height} should be higher than the previous block height {previous_block}" )] BlockHeightShouldBeHigherThanPrevious { height: BlockHeight, previous_block: BlockHeight, }, - #[display(fmt = "Previous block height {_0} doesn't exist")] + #[display("Previous block height {_0} doesn't exist")] MissingBlock(BlockHeight), #[display( - fmt = "Best finalized da_height {best} is behind previous block da_height {previous_block}" + "Best finalized da_height {best} is behind previous block da_height {previous_block}" )] InvalidDaFinalizationState { best: DaBlockHeight, diff --git a/crates/services/txpool_v2/src/error.rs b/crates/services/txpool_v2/src/error.rs index 7f9a22ffc93..3e9aff32351 100644 --- a/crates/services/txpool_v2/src/error.rs +++ b/crates/services/txpool_v2/src/error.rs @@ -15,41 +15,43 @@ use crate::ports::WasmValidityError; #[derive(Clone, Debug, derive_more::Display)] pub enum Error { - #[display(fmt = "Gas price not found for block height {_0}")] + #[display("Gas price not found for block height {_0}")] GasPriceNotFound(String), - #[display(fmt = "Database error: {_0}")] + #[display("Database error: {_0}")] Database(String), - #[display(fmt = "Storage error: {_0}")] + #[display("Storage error: {_0}")] Storage(String), - #[display(fmt = "Blacklisted error: {_0}")] + #[display("Blacklisted error: {_0}")] Blacklisted(BlacklistedError), - #[display(fmt = "Transaction collided: {_0}")] + #[display("Transaction collided: {_0}")] Collided(CollisionReason), - #[display(fmt = "Transaction input validation failed: {_0}")] + #[display("Transaction input validation failed: {_0}")] InputValidation(InputValidationError), - #[display(fmt = "Transaction dependency error: {_0}")] + #[display("Transaction dependency error: {_0}")] Dependency(DependencyError), - #[display(fmt = "Invalid transaction data: {_0:?}")] + #[display("Invalid transaction data: {_0:?}")] ConsensusValidity(CheckError), - #[display(fmt = "Error with Wasm validity: {:?}", _0)] + #[display("Error with Wasm validity: {:?}", _0)] WasmValidity(WasmValidityError), - #[display(fmt = "Mint transaction is not allowed")] + #[display("Mint transaction is not allowed")] MintIsDisallowed, - #[display(fmt = "Pool limit is hit, try to increase gas_price")] + #[display("Pool limit is hit, try to increase gas_price")] NotInsertedLimitHit, - #[display(fmt = "Transaction is removed: {_0}")] + #[display("Transaction is removed: {_0}")] Removed(RemovedReason), - #[display(fmt = "Transaction has been skipped during block insertion: {_0}")] + #[display("Transaction has been skipped during block insertion: {_0}")] SkippedTransaction(String), - #[display(fmt = "Too much transactions are in queue to be inserted. Can't add more")] + #[display("Too much transactions are in queue to be inserted. Can't add more")] TooManyQueuedTransactions, - #[display(fmt = "Unable send a request because service is closed")] + #[display("Unable send a request because service is closed")] ServiceCommunicationFailed, - #[display(fmt = "Request failed to be sent because service queue is full")] + #[display("Request failed to be sent because service queue is full")] ServiceQueueFull, - #[display(fmt = "The provided max fee can't cover the transaction cost. \ + #[display( + "The provided max fee can't cover the transaction cost. \ The minimal gas price should be {minimal_gas_price:?}, \ - while it is {max_gas_price_from_fee:?}")] + while it is {max_gas_price_from_fee:?}" + )] InsufficientMaxFee { /// The max gas price from the fee. max_gas_price_from_fee: Word, @@ -61,98 +63,98 @@ pub enum Error { #[derive(Clone, Debug, derive_more::Display)] pub enum RemovedReason { #[display( - fmt = "Transaction was removed because it was less worth than a new one (id: {_0}) that has been inserted" + "Transaction was removed because it was less worth than a new one (id: {_0}) that has been inserted" )] LessWorth(TxId), #[display( - fmt = "Transaction expired because it exceeded the configured time to live `tx-pool-ttl`." + "Transaction expired because it exceeded the configured time to live `tx-pool-ttl`." )] Ttl, } #[derive(Clone, Debug, derive_more::Display)] pub enum BlacklistedError { - #[display(fmt = "The UTXO `{_0}` is blacklisted")] + #[display("The UTXO `{_0}` is blacklisted")] BlacklistedUTXO(UtxoId), - #[display(fmt = "The owner `{_0}` is blacklisted")] + #[display("The owner `{_0}` is blacklisted")] BlacklistedOwner(Address), - #[display(fmt = "The contract `{_0}` is blacklisted")] + #[display("The contract `{_0}` is blacklisted")] BlacklistedContract(ContractId), - #[display(fmt = "The message `{_0}` is blacklisted")] + #[display("The message `{_0}` is blacklisted")] BlacklistedMessage(Nonce), } #[derive(Clone, Debug, derive_more::Display)] pub enum DependencyError { - #[display(fmt = "Collision is also a dependency")] + #[display("Collision is also a dependency")] NotInsertedCollisionIsDependency, - #[display(fmt = "Transaction chain dependency is already too big")] + #[display("Transaction chain dependency is already too big")] NotInsertedChainDependencyTooBig, - #[display(fmt = "The dependent transaction creates a diamond problem, \ - causing cycles in the dependency graph.")] + #[display( + "The dependent transaction creates a diamond problem, \ + causing cycles in the dependency graph." + )] DependentTransactionIsADiamondDeath, } #[derive(Clone, Debug, derive_more::Display)] pub enum InputValidationError { - #[display( - fmt = "Input output mismatch. Coin owner is different from expected input" - )] + #[display("Input output mismatch. Coin owner is different from expected input")] NotInsertedIoWrongOwner, - #[display(fmt = "Input output mismatch. Coin output does not match expected input")] + #[display("Input output mismatch. Coin output does not match expected input")] NotInsertedIoWrongAmount, #[display( - fmt = "Input output mismatch. Coin output asset_id does not match expected inputs" + "Input output mismatch. Coin output asset_id does not match expected inputs" )] NotInsertedIoWrongAssetId, - #[display(fmt = "Input message does not match the values from database")] + #[display("Input message does not match the values from database")] NotInsertedIoMessageMismatch, - #[display(fmt = "Input output mismatch. Expected coin but output is contract")] + #[display("Input output mismatch. Expected coin but output is contract")] NotInsertedIoContractOutput, #[display( - fmt = "Message id {_0:#x} does not match any received message from the DA layer." + "Message id {_0:#x} does not match any received message from the DA layer." )] NotInsertedInputMessageUnknown(Nonce), - #[display(fmt = "Input dependent on a Change or Variable output")] + #[display("Input dependent on a Change or Variable output")] NotInsertedInputDependentOnChangeOrVariable, - #[display(fmt = "UTXO input does not exist: {_0:#x}")] + #[display("UTXO input does not exist: {_0:#x}")] NotInsertedInputContractDoesNotExist(ContractId), - #[display(fmt = "BlobId is already taken {_0:#x}")] + #[display("BlobId is already taken {_0:#x}")] NotInsertedBlobIdAlreadyTaken(BlobId), - #[display(fmt = "Input coin does not match the values from database")] + #[display("Input coin does not match the values from database")] NotInsertedIoCoinMismatch, - #[display(fmt = "Wrong number of outputs: {_0}")] + #[display("Wrong number of outputs: {_0}")] WrongOutputNumber(String), - #[display(fmt = "UTXO (id: {_0}) does not exist")] + #[display("UTXO (id: {_0}) does not exist")] UtxoNotFound(UtxoId), - #[display(fmt = "Max gas can't be 0")] + #[display("Max gas can't be 0")] MaxGasZero, - #[display(fmt = "Transaction id already exists (id: {_0})")] + #[display("Transaction id already exists (id: {_0})")] DuplicateTxId(TxId), } #[derive(Debug, Clone, derive_more::Display)] pub enum CollisionReason { #[display( - fmt = "Transaction with the same UTXO (id: {_0}) already exists and is more worth it" + "Transaction with the same UTXO (id: {_0}) already exists and is more worth it" )] Utxo(UtxoId), #[display( - fmt = "Transaction that create the same contract (id: {_0}) already exists and is more worth it" + "Transaction that create the same contract (id: {_0}) already exists and is more worth it" )] ContractCreation(ContractId), #[display( - fmt = "Transaction that use the same blob (id: {_0}) already exists and is more worth it" + "Transaction that use the same blob (id: {_0}) already exists and is more worth it" )] Blob(BlobId), #[display( - fmt = "Transaction that use the same message (id: {_0}) already exists and is more worth it" + "Transaction that use the same message (id: {_0}) already exists and is more worth it" )] Message(Nonce), - #[display(fmt = "This transaction have an unknown collision")] + #[display("This transaction have an unknown collision")] Unknown, #[display( - fmt = "This transaction have dependencies and is colliding with multiple transactions" + "This transaction have dependencies and is colliding with multiple transactions" )] MultipleCollisions, } diff --git a/crates/services/upgradable-executor/src/error.rs b/crates/services/upgradable-executor/src/error.rs index 70fd690fea1..c7ba7d27dac 100644 --- a/crates/services/upgradable-executor/src/error.rs +++ b/crates/services/upgradable-executor/src/error.rs @@ -3,12 +3,12 @@ #[allow(missing_docs)] #[derive(Debug, Clone, PartialEq, derive_more::Display, derive_more::From)] pub enum UpgradableError { - #[display(fmt = "Invalid WASM bytecode: {_0}")] + #[display("Invalid WASM bytecode: {_0}")] #[cfg(feature = "wasm-executor")] InvalidWasm(String), - #[display(fmt = "The uploaded bytecode with root {_0} is incomplete")] + #[display("The uploaded bytecode with root {_0} is incomplete")] IncompleteUploadedBytecode(fuel_core_types::fuel_tx::Bytes32), /// Normal errors from the executor - #[display(fmt = "Executor error: {_0}")] + #[display("Executor error: {_0}")] ExecutorError(fuel_core_types::services::executor::Error), } diff --git a/crates/storage/src/lib.rs b/crates/storage/src/lib.rs index c54fbf889b8..e3ea8c6be4b 100644 --- a/crates/storage/src/lib.rs +++ b/crates/storage/src/lib.rs @@ -65,13 +65,13 @@ pub type Result = core::result::Result; /// Error occurring during interaction with storage pub enum Error { /// Error occurred during serialization or deserialization of the entity. - #[display(fmt = "error performing serialization or deserialization `{_0}`")] + #[display("error performing serialization or deserialization `{_0}`")] Codec(anyhow::Error), /// Error occurred during interaction with database. - #[display(fmt = "error occurred in the underlying datastore `{_0:?}`")] + #[display("error occurred in the underlying datastore `{_0:?}`")] DatabaseError(Box), /// This error should be created with `not_found` macro. - #[display(fmt = "resource was not found in table `{_0}` at the: {_1}")] + #[display("resource was not found in table `{_0}` at the: {_1}")] NotFound(&'static str, &'static str), // TODO: Do we need this type at all? /// Unknown or not expected(by architecture) error. diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index cbb69a1beda..3068a3b3972 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -20,9 +20,7 @@ version = { workspace = true } anyhow = { workspace = true } aws-sdk-kms = { workspace = true, optional = true } bs58 = { version = "0.5", optional = true } -derivative = { version = "2", default-features = false, optional = true, features = [ - "use_core", -] } +educe = { version = "0.6", features = ["Eq", "PartialEq", "Hash", "Debug"], default-features = false, optional = true } derive_more = { version = "0.99" } fuel-vm-private = { workspace = true, default-features = false, features = [ "alloc", @@ -41,7 +39,7 @@ tokio = { workspace = true, features = ["macros"] } [features] default = ["std"] -alloc = ["fuel-vm-private/alloc", "derivative"] +alloc = ["fuel-vm-private/alloc", "educe"] serde = ["dep:serde", "fuel-vm-private/serde"] da-compression = ["fuel-vm-private/da-compression"] std = ["alloc", "fuel-vm-private/std", "bs58"] diff --git a/crates/types/src/blockchain/header.rs b/crates/types/src/blockchain/header.rs index 3dc39a683c8..036b5384e61 100644 --- a/crates/types/src/blockchain/header.rs +++ b/crates/types/src/blockchain/header.rs @@ -19,11 +19,12 @@ use crate::{ MessageId, }, }; +use educe::Educe; use tai64::Tai64; /// Version-able block header type -#[derive(Clone, Debug, derivative::Derivative)] -#[derivative(PartialEq, Eq)] +#[derive(Clone, Debug, Educe)] +#[educe(PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum BlockHeader { /// V1 BlockHeader @@ -32,8 +33,8 @@ pub enum BlockHeader { /// A fuel block header that has all the fields generated because it /// has been executed. -#[derive(Clone, Debug, derivative::Derivative)] -#[derivative(PartialEq, Eq)] +#[derive(Clone, Debug, Educe)] +#[educe(PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct BlockHeaderV1 { /// The application header. @@ -43,7 +44,7 @@ pub struct BlockHeaderV1 { /// The header metadata calculated during creation. /// The field is private to enforce the use of the [`PartialBlockHeader::generate`] method. #[cfg_attr(feature = "serde", serde(skip))] - #[derivative(PartialEq = "ignore")] + #[educe(PartialEq(ignore))] metadata: Option, }