From 76ba15d520fc4672dd69e509ae1271cb1845dcf5 Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Wed, 17 Jan 2024 11:02:05 -0500 Subject: [PATCH] fix test data --- .../block/output/unlock_condition/timelock.rs | 6 ++-- .../types/fixtures/tip42_account_output.json | 16 +++++----- .../types/fixtures/tip44_foundry_output.json | 6 ++-- .../types/fixtures/tip54_anchor_output.json | 11 ++----- sdk/tests/types/storage_score.rs | 32 +++++++++++-------- 5 files changed, 34 insertions(+), 37 deletions(-) diff --git a/sdk/src/types/block/output/unlock_condition/timelock.rs b/sdk/src/types/block/output/unlock_condition/timelock.rs index b9ac9aef90..cf17805ee0 100644 --- a/sdk/src/types/block/output/unlock_condition/timelock.rs +++ b/sdk/src/types/block/output/unlock_condition/timelock.rs @@ -59,14 +59,14 @@ pub(crate) mod dto { struct TimelockUnlockConditionDto { #[serde(rename = "type")] kind: u8, - slot_index: SlotIndex, + slot: SlotIndex, } impl From<&TimelockUnlockCondition> for TimelockUnlockConditionDto { fn from(value: &TimelockUnlockCondition) -> Self { Self { kind: TimelockUnlockCondition::KIND, - slot_index: value.slot_index(), + slot: value.slot_index(), } } } @@ -75,7 +75,7 @@ pub(crate) mod dto { type Error = Error; fn try_from(value: TimelockUnlockConditionDto) -> Result { - Self::new(value.slot_index).map_err(|_| Error::InvalidField("timelockUnlockCondition")) + Self::new(value.slot).map_err(|_| Error::InvalidField("timelockUnlockCondition")) } } diff --git a/sdk/tests/types/fixtures/tip42_account_output.json b/sdk/tests/types/fixtures/tip42_account_output.json index e9dd4b1816..52231b1707 100644 --- a/sdk/tests/types/fixtures/tip42_account_output.json +++ b/sdk/tests/types/fixtures/tip42_account_output.json @@ -15,6 +15,13 @@ } ], "features": [ + { + "type": 0, + "address": { + "type": 0, + "pubKeyHash": "0xed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a" + } + }, { "type": 6, "expirySlot": 888, @@ -38,13 +45,6 @@ } ], "immutableFeatures": [ - { - "type": 0, - "address": { - "type": 0, - "pubKeyHash": "0xed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a" - } - }, { "type": 2, "entries": { @@ -53,6 +53,6 @@ } ] }, - "bytes": "0x0100c2eb0b00000000402dd91300000000e8494fe353f99783d3771c78798e1e839e649310513770fc6dc974fe53cf1a8600000000010000ed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a02067803000002009e05a32eafedefd40298e24ad4f8c334580187f7e9afbd9da13b5ba4007dd1b500a504844f7a0df2c5101d31696593b309040f8660d41035aba508f24c00668b210780d1f00800000000900100000000000019000000ffffffff020000ed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a020104696f74610300322e30", + "bytes": "0x0100c2eb0b00000000402dd91300000000e8494fe353f99783d3771c78798e1e839e649310513770fc6dc974fe53cf1a8600000000010000ed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a030000ed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a067803000002009e05a32eafedefd40298e24ad4f8c334580187f7e9afbd9da13b5ba4007dd1b500a504844f7a0df2c5101d31696593b309040f8660d41035aba508f24c00668b210780d1f00800000000900100000000000019000000ffffffff01020104696f74610300322e30", "storage_score": 621 } diff --git a/sdk/tests/types/fixtures/tip44_foundry_output.json b/sdk/tests/types/fixtures/tip44_foundry_output.json index 360d782443..5ace14f67f 100644 --- a/sdk/tests/types/fixtures/tip44_foundry_output.json +++ b/sdk/tests/types/fixtures/tip44_foundry_output.json @@ -2,7 +2,7 @@ "output": { "type": 3, "amount": "420000000", - "serialNumber": 0, + "serialNumber": 1, "tokenScheme": { "type": 0, "mintedTokens": "0x9c40", @@ -27,11 +27,11 @@ }, { "type": 5, - "id": "0x0817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a0000000000", + "id": "0x0817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a0100000000", "amount": "0xa410" } ] }, - "bytes": "0x0300b10819000000000000000000409c000000000000000000000000000000000000000000000000000000000000102700000000000000000000000000000000000000000000000000000000000050c300000000000000000000000000000000000000000000000000000000000001060817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a02020104696f74612e00322e3030303030303030303030303030303030303030303030303030303030303030303030303030303030303030050817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a000000000010a400000000000000000000000000000000000000000000000000000000000000", + "bytes": "0x0300b10819000000000100000000409c000000000000000000000000000000000000000000000000000000000000102700000000000000000000000000000000000000000000000000000000000050c300000000000000000000000000000000000000000000000000000000000001060817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a02020104696f74612e00322e3030303030303030303030303030303030303030303030303030303030303030303030303030303030303030050817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a010000000010a400000000000000000000000000000000000000000000000000000000000000", "storage_score": 361 } diff --git a/sdk/tests/types/fixtures/tip54_anchor_output.json b/sdk/tests/types/fixtures/tip54_anchor_output.json index b15bf0f250..8df8b8f9f0 100644 --- a/sdk/tests/types/fixtures/tip54_anchor_output.json +++ b/sdk/tests/types/fixtures/tip54_anchor_output.json @@ -22,13 +22,6 @@ } ], "features": [ - { - "type": 0, - "address": { - "type": 0, - "pubKeyHash": "0xed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a" - } - }, { "type": 2, "entries": { @@ -45,6 +38,6 @@ } ] }, - "bytes": "0x0200b10819000000002a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000002040817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a050817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a020000ed1484f4d1f7d8c037087fed661dd92faccae1eed3c01182d6fdd6828cea144a020104696f74610300322e3001020104696f74610300322e30", - "storage_score": 270 + "bytes": "0x0200b10819000000002a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000002040817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a050817432c5a7a672503480241125e3952414a7a320441080c624c264b004e09614a01020104696f74610300322e3001020104696f74610300322e30", + "storage_score": 236 } diff --git a/sdk/tests/types/storage_score.rs b/sdk/tests/types/storage_score.rs index fd8608a8f1..b0889ebfdd 100644 --- a/sdk/tests/types/storage_score.rs +++ b/sdk/tests/types/storage_score.rs @@ -1,10 +1,8 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_sdk::{ - types::block::output::{Output, StorageScore, StorageScoreParameters}, - utils::serde::prefix_hex_bytes, -}; +use iota_sdk::types::block::output::{Output, StorageScore, StorageScoreParameters}; +use packable::PackableExt; use pretty_assertions::assert_eq; use serde::Deserialize; @@ -20,8 +18,7 @@ fn storage_score_parameters() -> Result, + bytes: String, storage_score: u64, } @@ -34,17 +31,24 @@ fn output_fixture(filename: &str) -> Result