Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address post-merge nits #1711

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

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

3 changes: 0 additions & 3 deletions bindings/python/iota_sdk/client/_node_indexer_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
from iota_sdk.types.common import HexStr, json, SlotIndex
from iota_sdk.types.output_id import OutputId

from iota_sdk.types.common import HexStr
from iota_sdk.types.output_id import OutputId


@json
@dataclass
Expand Down
2 changes: 0 additions & 2 deletions bindings/python/iota_sdk/types/utxo_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from typing import List

from dataclasses import dataclass
from iota_sdk.types.common import HexStr

from iota_sdk.types.common import HexStr, json


Expand Down
4 changes: 2 additions & 2 deletions sdk/tests/client/signing/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async fn sign_account_state_transition() -> Result<()> {
let unlocks = secret_manager.transaction_unlocks(&prepared_transaction_data).await?;

assert_eq!(unlocks.len(), 1);
assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND);
assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND);

let tx_payload = SignedTransactionPayload::new(prepared_transaction_data.transaction.clone(), unlocks)?;

Expand Down Expand Up @@ -186,7 +186,7 @@ async fn account_reference_unlocks() -> Result<()> {
let unlocks = secret_manager.transaction_unlocks(&prepared_transaction_data).await?;

assert_eq!(unlocks.len(), 3);
assert_eq!((*unlocks).get(0).unwrap().kind(), SignatureUnlock::KIND);
assert_eq!((*unlocks).first().unwrap().kind(), SignatureUnlock::KIND);
match (*unlocks).get(1).unwrap() {
Unlock::Account(a) => {
assert_eq!(a.index(), 0);
Expand Down
14 changes: 6 additions & 8 deletions sdk/tests/types/output_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ use core::str::FromStr;
use iota_sdk::types::block::{
output::OutputId,
payload::signed_transaction::{TransactionHash, TransactionId},
Error,
};
use packable::{bounded::InvalidBoundedU16, error::UnpackError, PackableExt};
use packable::PackableExt;
use pretty_assertions::assert_eq;

const TRANSACTION_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64900000000";
const OUTPUT_ID: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649000000002a00";
const OUTPUT_ID_INVALID_INDEX: &str = "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649000000008000";

#[test]
fn debug_impl() {
Expand All @@ -31,7 +29,7 @@ fn debug_impl() {
}

#[test]
fn new_valid() {
fn new() {
let transaction_id = TransactionId::from_str(TRANSACTION_ID).unwrap();
let output_id = OutputId::new(transaction_id, 42);

Expand All @@ -58,17 +56,17 @@ fn split_valid() {
}

#[test]
fn try_from_valid() {
fn from_bytes() {
let transaction_id = TransactionId::from_str(TRANSACTION_ID).unwrap();
let output_id_bytes: [u8; OutputId::LENGTH] = prefix_hex::decode(OUTPUT_ID).unwrap();
let output_id = OutputId::try_from(output_id_bytes).unwrap();
let output_id = OutputId::from(output_id_bytes);

assert_eq!(*output_id.transaction_id(), transaction_id);
assert_eq!(output_id.index(), 42);
}

#[test]
fn from_str_valid() {
fn from_str() {
let transaction_id = TransactionId::from_str(TRANSACTION_ID).unwrap();
let output_id = OutputId::from_str(OUTPUT_ID).unwrap();

Expand Down Expand Up @@ -98,7 +96,7 @@ fn packed_len() {
}

#[test]
fn pack_unpack_valid() {
fn pack_unpack() {
let output_id_1 = OutputId::from_str(OUTPUT_ID).unwrap();
let output_id_2 = OutputId::unpack_verified(output_id_1.pack_to_vec().as_slice(), &()).unwrap();

Expand Down
Loading