Skip to content

Commit

Permalink
Reset Output types
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Oct 5, 2023
1 parent 691e978 commit d99b25a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
8 changes: 6 additions & 2 deletions sdk/src/types/block/output/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ impl From<&OutputId> for AccountId {
impl AccountId {
///
pub fn or_from_output_id(self, output_id: &OutputId) -> Self {
if self.is_null() { Self::from(output_id) } else { self }
if self.is_null() {
Self::from(output_id)
} else {
self
}
}
}

Expand Down Expand Up @@ -392,7 +396,7 @@ pub struct AccountOutput {

impl AccountOutput {
/// The [`Output`](crate::types::block::output::Output) kind of an [`AccountOutput`].
pub const KIND: u8 = 4;
pub const KIND: u8 = 1;
/// Maximum possible length in bytes of the state metadata.
pub const STATE_METADATA_LENGTH_MAX: u16 = 8192;
/// The set of allowed [`UnlockCondition`]s for an [`AccountOutput`].
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/types/block/output/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ pub struct BasicOutput {

impl BasicOutput {
/// The [`Output`](crate::types::block::output::Output) kind of an [`BasicOutput`].
pub const KIND: u8 = 3;
pub const KIND: u8 = 0;

/// The set of allowed [`UnlockCondition`]s for an [`BasicOutput`].
const ALLOWED_UNLOCK_CONDITIONS: UnlockConditionFlags = UnlockConditionFlags::ADDRESS
Expand Down
8 changes: 6 additions & 2 deletions sdk/src/types/block/output/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ impl From<&OutputId> for DelegationId {

impl DelegationId {
pub fn or_from_output_id(self, output_id: &OutputId) -> Self {
if self.is_null() { Self::from(output_id) } else { self }
if self.is_null() {
Self::from(output_id)
} else {
self
}
}
}

Expand Down Expand Up @@ -259,7 +263,7 @@ pub struct DelegationOutput {

impl DelegationOutput {
/// The [`Output`](crate::types::block::output::Output) kind of a [`DelegationOutput`].
pub const KIND: u8 = 7;
pub const KIND: u8 = 4;
/// The set of allowed [`UnlockCondition`]s for a [`DelegationOutput`].
pub const ALLOWED_UNLOCK_CONDITIONS: UnlockConditionFlags = UnlockConditionFlags::ADDRESS;

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/types/block/output/foundry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ pub struct FoundryOutput {

impl FoundryOutput {
/// The [`Output`](crate::types::block::output::Output) kind of a [`FoundryOutput`].
pub const KIND: u8 = 5;
pub const KIND: u8 = 2;
/// The set of allowed [`UnlockCondition`]s for a [`FoundryOutput`].
pub const ALLOWED_UNLOCK_CONDITIONS: UnlockConditionFlags = UnlockConditionFlags::IMMUTABLE_ACCOUNT_ADDRESS;
/// The set of allowed [`Feature`]s for a [`FoundryOutput`].
Expand Down
8 changes: 6 additions & 2 deletions sdk/src/types/block/output/nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ impl From<&OutputId> for NftId {
impl NftId {
///
pub fn or_from_output_id(self, output_id: &OutputId) -> Self {
if self.is_null() { Self::from(output_id) } else { self }
if self.is_null() {
Self::from(output_id)
} else {
self
}
}
}

Expand Down Expand Up @@ -305,7 +309,7 @@ pub struct NftOutput {

impl NftOutput {
/// The [`Output`](crate::types::block::output::Output) kind of an [`NftOutput`].
pub const KIND: u8 = 6;
pub const KIND: u8 = 3;
/// The set of allowed [`UnlockCondition`]s for an [`NftOutput`].
pub const ALLOWED_UNLOCK_CONDITIONS: UnlockConditionFlags = UnlockConditionFlags::ADDRESS
.union(UnlockConditionFlags::STORAGE_DEPOSIT_RETURN)
Expand Down

0 comments on commit d99b25a

Please sign in to comment.