Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dkwcs committed Feb 6, 2025
1 parent a6e48d8 commit f1349a6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/iota-framework-snapshot/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
]
},
"4": {
"git_revision": "ed789b04a2ee",
"git_revision": "a6e48d86090c-dirty",
"package_ids": [
"0x0000000000000000000000000000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000000000000000000000000000002",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

#[allow(deprecated_usage)]
module stardust::irc27 {

use std::uq32_32::UQ32_32;
use std::fixed_point32::FixedPoint32;
use std::string::String;

use iota::url::Url;
Expand Down Expand Up @@ -36,7 +37,7 @@ module stardust::irc27 {
/// Royalty payment addresses mapped to the payout percentage.
/// Contains a hash of the 32 bytes parsed from the BECH32 encoded IOTA address in the metadata, it is a legacy address.
/// Royalties are not supported by the protocol and needed to be processed by an integrator.
royalties: VecMap<address, UQ32_32>,
royalties: VecMap<address, FixedPoint32>,

/// The human-readable name of the NFT creator.
issuer_name: Option<String>,
Expand Down Expand Up @@ -77,7 +78,7 @@ module stardust::irc27 {
}

/// Get the metadata's `royalties`.
public fun royalties(irc27: &Irc27Metadata): &VecMap<address, UQ32_32> {
public fun royalties(irc27: &Irc27Metadata): &VecMap<address, FixedPoint32> {
&irc27.royalties
}

Expand Down Expand Up @@ -124,7 +125,7 @@ module stardust::irc27 {
uri: Url,
name: String,
collection_name: Option<String>,
royalties: VecMap<address, UQ32_32>,
royalties: VecMap<address, FixedPoint32>,
issuer_name: Option<String>,
description: Option<String>,
attributes: VecMap<String, String>,
Expand Down
7 changes: 4 additions & 3 deletions crates/iota-framework/packages/stardust/tests/nft_tests.move
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0

#[test_only]
#[allow(deprecated_usage)]
module stardust::nft_tests {

use std::ascii;
use std::uq32_32;
use std::fixed_point32;
use std::string;
use std::type_name;

Expand Down Expand Up @@ -55,7 +56,7 @@ module stardust::nft_tests {

// Create an Nft object.
let mut royalties = vec_map::empty();
royalties.insert(sender, uq32_32::from_quotient(1, 2));
royalties.insert(sender, fixed_point32::create_from_rational(1, 2));

let mut attributes = vec_map::empty();
attributes.insert(string::utf8(b"attribute"), string::utf8(b"value"));
Expand Down Expand Up @@ -111,7 +112,7 @@ module stardust::nft_tests {
assert!(nft.immutable_metadata().name() == string::utf8(b"nft"), 10);
assert!(nft.immutable_metadata().collection_name().contains(&string::utf8(b"collection")), 11);
assert!(nft.immutable_metadata().royalties().size() == 1, 12);
assert!(nft.immutable_metadata().royalties().get(&sender) == uq32_32::from_quotient(1, 2), 13);
assert!(nft.immutable_metadata().royalties().get(&sender) == fixed_point32::create_from_rational(1, 2), 13);
assert!(nft.immutable_metadata().issuer_name().contains(&string::utf8(b"issuer")), 14);
assert!(nft.immutable_metadata().description().contains(&string::utf8(b"description")), 15);
assert!(nft.immutable_metadata().attributes().size() == 1, 16);
Expand Down
Binary file modified crates/iota-framework/packages_compiled/stardust
Binary file not shown.

0 comments on commit f1349a6

Please sign in to comment.