Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanoroshiba committed Oct 2, 2024
1 parent 9c49e9a commit 6f80edd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions crates/astria-core/src/protocol/transaction/v1alpha1/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(),
})
}

Expand All @@ -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,
Expand Down

0 comments on commit 6f80edd

Please sign in to comment.