-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(platform)!: disable credit withdrawals in V1 (#1961)
- Loading branch information
1 parent
08a8aea
commit 1739623
Showing
16 changed files
with
361 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/rs-dpp/src/errors/consensus/basic/unsupported_feature_error.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use crate::consensus::basic::BasicError; | ||
use crate::consensus::ConsensusError; | ||
use crate::errors::ProtocolError; | ||
use bincode::{Decode, Encode}; | ||
use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; | ||
|
||
use thiserror::Error; | ||
|
||
#[derive( | ||
Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, | ||
)] | ||
#[error("feature {feature_name} is not supported in version {current_protocol_version}")] | ||
#[platform_serialize(unversioned)] | ||
pub struct UnsupportedFeatureError { | ||
/* | ||
DO NOT CHANGE ORDER OF FIELDS WITHOUT INTRODUCING OF NEW VERSION | ||
*/ | ||
feature_name: String, | ||
current_protocol_version: u32, | ||
} | ||
|
||
impl UnsupportedFeatureError { | ||
pub fn new(feature_name: String, current_protocol_version: u32) -> Self { | ||
Self { | ||
feature_name, | ||
current_protocol_version, | ||
} | ||
} | ||
|
||
pub fn feature(&self) -> &String { | ||
&self.feature_name | ||
} | ||
|
||
pub fn current_protocol_version(&self) -> u32 { | ||
self.current_protocol_version | ||
} | ||
} | ||
|
||
impl From<UnsupportedFeatureError> for ConsensusError { | ||
fn from(err: UnsupportedFeatureError) -> Self { | ||
Self::BasicError(BasicError::UnsupportedFeatureError(err)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...validation/state_transition/state_transitions/identity_credit_withdrawal/structure/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub(crate) mod v0; | ||
pub(crate) mod v1; |
Oops, something went wrong.