From 6f80edd79f8b899c7e750b939b16eb9bfd5d11ed Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Wed, 2 Oct 2024 08:46:09 -0500 Subject: [PATCH] minor changes --- .../src/protocol/transaction/v1alpha1/action.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/astria-core/src/protocol/transaction/v1alpha1/action.rs b/crates/astria-core/src/protocol/transaction/v1alpha1/action.rs index 44e70d65dc..55adcc97d3 100644 --- a/crates/astria-core/src/protocol/transaction/v1alpha1/action.rs +++ b/crates/astria-core/src/protocol/transaction/v1alpha1/action.rs @@ -766,7 +766,7 @@ impl ValidatorUpdateWithNameError { #[derive(Debug, thiserror::Error)] enum ValidatorUpdateWithNameErrorKind { - #[error("the inner validator update was invalid from the action")] + #[error("the action's inner validator update was invalid")] InvalidInnerValidatorUpdate(#[source] ValidatorUpdateError), #[error("the inner validator update was missing from the action")] MissingInnerValidatorUpdate, @@ -787,15 +787,14 @@ impl Protobuf for ValidatorUpdateWithName { validator_update, name, } = raw; - let validator_update = validator_update + let raw_validator_update = validator_update .clone() .ok_or(ValidatorUpdateWithNameError::missing_inner_validator_update())?; - let validator_update = ValidatorUpdate::try_from_raw(validator_update) + let validator_update = ValidatorUpdate::try_from_raw(raw_validator_update) .map_err(ValidatorUpdateWithNameError::invalid_inner_validator_update)?; - let name = name.clone(); Ok(Self { validator_update, - name, + name: name.clone(), }) } @@ -804,11 +803,10 @@ impl Protobuf for ValidatorUpdateWithName { validator_update, name, } = raw; - let validator_update = validator_update + let raw_validator_update = validator_update .ok_or(ValidatorUpdateWithNameError::missing_inner_validator_update())?; - let validator_update = ValidatorUpdate::try_from_raw(validator_update) + let validator_update = ValidatorUpdate::try_from_raw(raw_validator_update) .map_err(ValidatorUpdateWithNameError::invalid_inner_validator_update)?; - let name = name.clone(); Ok(Self { validator_update, name,