Skip to content

Commit

Permalink
Fix SelfControlledAliasOutput and SelfDepositNft conditions (#1862)
Browse files Browse the repository at this point in the history
* Fix `SelfControlledAliasOutput` and `SelfDepositNft` conditions

* Fix cargo audit

* Prepare release
  • Loading branch information
thibault-martinez authored Jan 22, 2024
1 parent 9d1bc8a commit ff1b466
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 27 deletions.
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security -->

## 1.1.4 - 2024-MM-DD
## 1.1.4 - 2024-01-22

### Added

Expand All @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- `Ed25519Signature` type no longer requires validated public key bytes to construct;
- `SelfControlledAliasOutput` and `SelfDepositNft` conditions;

## 1.1.3 - 2023-12-07

Expand Down
4 changes: 2 additions & 2 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iota-sdk"
version = "1.1.3"
version = "1.1.4"
authors = ["IOTA Stiftung"]
edition = "2021"
description = "The IOTA SDK provides developers with a seamless experience to develop on IOTA by providing account abstractions and clients to interact with node APIs."
Expand Down Expand Up @@ -882,4 +882,4 @@ required-features = ["stronghold"]
# Allowed only for examples, denied again in lib.rs
[lints.clippy]
expect_fun_call = "allow"
single_element_loop = "allow"
single_element_loop = "allow"
4 changes: 2 additions & 2 deletions sdk/src/types/block/output/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ fn verify_index_counter(alias_id: &AliasId, state_index: u32, foundry_counter: u
fn verify_unlock_conditions(unlock_conditions: &UnlockConditions, alias_id: &AliasId) -> Result<(), Error> {
if let Some(unlock_condition) = unlock_conditions.state_controller_address() {
if let Address::Alias(alias_address) = unlock_condition.address() {
if alias_address.alias_id() == alias_id {
if !alias_id.is_null() && alias_address.alias_id() == alias_id {
return Err(Error::SelfControlledAliasOutput(*alias_id));
}
}
Expand All @@ -695,7 +695,7 @@ fn verify_unlock_conditions(unlock_conditions: &UnlockConditions, alias_id: &Ali

if let Some(unlock_condition) = unlock_conditions.governor_address() {
if let Address::Alias(alias_address) = unlock_condition.address() {
if alias_address.alias_id() == alias_id {
if !alias_id.is_null() && alias_address.alias_id() == alias_id {
return Err(Error::SelfControlledAliasOutput(*alias_id));
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/types/block/output/nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ impl Packable for NftOutput {
fn verify_unlock_conditions(unlock_conditions: &UnlockConditions, nft_id: &NftId) -> Result<(), Error> {
if let Some(unlock_condition) = unlock_conditions.address() {
if let Address::Nft(nft_address) = unlock_condition.address() {
if nft_address.nft_id() == nft_id {
if !nft_id.is_null() && nft_address.nft_id() == nft_id {
return Err(Error::SelfDepositNft(*nft_id));
}
}
Expand Down

0 comments on commit ff1b466

Please sign in to comment.