Skip to content

Commit

Permalink
Update feature types (#1654)
Browse files Browse the repository at this point in the history
* Update feature types

* fmt

---------

Co-authored-by: Thibault Martinez <[email protected]>
  • Loading branch information
Thoralf-M and thibault-martinez authored Nov 20, 2023
1 parent 5608a7e commit b6d1454
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
12 changes: 9 additions & 3 deletions bindings/nodejs/lib/types/block/output/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ enum FeatureType {
Issuer = 1,
/** A Metadata feature. */
Metadata = 2,
/** A StateMetadata feature. */
StateMetadata = 3,
/** A Tag feature. */
Tag = 3,
BlockIssuer = 4,
Staking = 5,
Tag = 4,
/** A NativeToken feature. */
NativeToken = 5,
/** A BlockIssuer feature. */
BlockIssuer = 6,
/** A Staking feature. */
Staking = 7,
}

/** The base class for features. */
Expand Down
18 changes: 10 additions & 8 deletions bindings/python/iota_sdk/types/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ class FeatureType(IntEnum):
Sender (0): The sender feature.
Issuer (1): The issuer feature.
Metadata (2): The metadata feature.
Tag (3): The tag feature.
NativeToken (4): The native token feature.
BlockIssuer (5): The block issuer feature.
Staking (6): The staking feature.
StateMetadata (3): The state metadata feature.
Tag (4): The tag feature.
NativeToken (5): The native token feature.
BlockIssuer (6): The block issuer feature.
Staking (7): The staking feature.
"""
Sender = 0
Issuer = 1
Metadata = 2
Tag = 3
NativeToken = 4
BlockIssuer = 5
Staking = 6
StateMetadata = 3
Tag = 4
NativeToken = 5
BlockIssuer = 6
Staking = 7


@json
Expand Down
6 changes: 1 addition & 5 deletions sdk/src/types/block/output/anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ impl From<&OutputId> for AnchorId {
impl AnchorId {
///
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
2 changes: 1 addition & 1 deletion sdk/src/types/block/output/feature/block_issuer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub struct BlockIssuerFeature {

impl BlockIssuerFeature {
/// The [`Feature`](crate::types::block::output::Feature) kind of a [`BlockIssuerFeature`].
pub const KIND: u8 = 5;
pub const KIND: u8 = 6;

/// Creates a new [`BlockIssuerFeature`].
#[inline(always)]
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/types/block/output/feature/native_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct NativeTokenFeature(NativeToken);

impl NativeTokenFeature {
/// The [`Feature`](crate::types::block::output::Feature) kind of [`NativeTokenFeature`].
pub const KIND: u8 = 4;
pub const KIND: u8 = 5;

/// Creates a new [`NativeTokenFeature`].
pub fn new(native_token: NativeToken) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/types/block/output/feature/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct StakingFeature {

impl StakingFeature {
/// The [`Feature`](crate::types::block::output::Feature) kind of [`StakingFeature`].
pub const KIND: u8 = 6;
pub const KIND: u8 = 7;

/// Creates a new [`StakingFeature`].
pub fn new(
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/types/block/output/feature/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl TryFrom<Box<[u8]>> for TagFeature {

impl TagFeature {
/// The [`Feature`](crate::types::block::output::Feature) kind of an [`TagFeature`].
pub const KIND: u8 = 3;
pub const KIND: u8 = 4;
/// Valid lengths for an [`TagFeature`].
pub const LENGTH_RANGE: RangeInclusive<u8> = 1..=64;

Expand Down

0 comments on commit b6d1454

Please sign in to comment.