Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename DataContractConfig.validate_config_update #1843

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/rs-dpp/src/data_contract/config/methods/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mod validate_config_update;
mod validate_update;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use platform_version::version::PlatformVersion;
mod v0;

impl DataContractConfig {
pub fn validate_config_update(
pub fn validate_update(
&self,
new_config: &DataContractConfig,
contract_id: Identifier,
Expand All @@ -19,9 +19,9 @@ impl DataContractConfig {
.data_contract
.validate_config_update
{
0 => Ok(self.validate_config_update_v0(new_config, contract_id)),
0 => Ok(self.validate_update_v0(new_config, contract_id)),
version => Err(ProtocolError::UnknownVersionMismatch {
method: "validate_config_update".to_string(),
method: "validate_update".to_string(),
known_versions: vec![0],
received: version,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use platform_value::Identifier;

impl DataContractConfig {
#[inline(always)]
pub(super) fn validate_config_update_v0(
pub(super) fn validate_update_v0(
&self,
new_config: &DataContractConfig,
contract_id: Identifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
// * Failure (contract does not exist): Keep ST and transform it to a nonce bump action.
// * How: A user pushed an update to a contract that changed its configuration.

let config_validation_result = old_data_contract.config().validate_config_update(
let config_validation_result = old_data_contract.config().validate_update(
new_data_contract.config(),
self.data_contract().id(),
platform_version,
Expand Down Expand Up @@ -480,5 +480,5 @@
})
.collect();

return ConsensusValidationResult::new_with_data_and_errors(bump_action, errors);

Check warning on line 483 in packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_update/state/v0/mod.rs

View workflow job for this annotation

GitHub Actions / Rust packages (drive-abci) / Linting

unneeded `return` statement

warning: unneeded `return` statement --> packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/data_contract_update/state/v0/mod.rs:483:5 | 483 | return ConsensusValidationResult::new_with_data_and_errors(bump_action, errors); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 483 - return ConsensusValidationResult::new_with_data_and_errors(bump_action, errors); 483 + ConsensusValidationResult::new_with_data_and_errors(bump_action, errors) |
}
Loading