From b4821d471c6c5129529be88863d886d8ea4b74c3 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Fri, 20 Oct 2023 19:02:35 +0200 Subject: [PATCH 1/4] Fix python SDK lint --- bindings/python/iota_sdk/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bindings/python/iota_sdk/utils.py b/bindings/python/iota_sdk/utils.py index 6c80489570..5e232e7fd4 100644 --- a/bindings/python/iota_sdk/utils.py +++ b/bindings/python/iota_sdk/utils.py @@ -13,11 +13,14 @@ from iota_sdk.types.output_id import OutputId from iota_sdk.types.output import Output from iota_sdk.external import call_utils_method +from iota_sdk.types.payload import TransactionPayload # Required to prevent circular import if TYPE_CHECKING: from iota_sdk.types.block.wrapper import BlockWrapper +# pylint: disable=too-many-public-methods + class Utils(): """Utility functions. From edaba268f1ba3e43ac158286a8999d334dcf3a4c Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Fri, 20 Oct 2023 19:43:49 +0200 Subject: [PATCH 2/4] More changes --- bindings/nodejs/examples/how_tos/account_output/create.ts | 2 +- bindings/nodejs/lib/wallet/account.ts | 2 +- bindings/python/tests/test_block.py | 3 +-- bindings/python/tests/test_offline.py | 2 +- bindings/python/tests/test_output.py | 2 +- sdk/tests/client/node_api/indexer.rs | 8 ++++---- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bindings/nodejs/examples/how_tos/account_output/create.ts b/bindings/nodejs/examples/how_tos/account_output/create.ts index c72d9773f7..d5872abc0b 100644 --- a/bindings/nodejs/examples/how_tos/account_output/create.ts +++ b/bindings/nodejs/examples/how_tos/account_output/create.ts @@ -47,7 +47,7 @@ async function run() { console.log('Sending the create-account transaction...'); // Create an account output - const transaction = await account.createAliasOutput(); + const transaction = await account.createAccountOutput(); console.log(`Transaction sent: ${transaction.transactionId}`); diff --git a/bindings/nodejs/lib/wallet/account.ts b/bindings/nodejs/lib/wallet/account.ts index 268ea708bf..7613ac7a18 100644 --- a/bindings/nodejs/lib/wallet/account.ts +++ b/bindings/nodejs/lib/wallet/account.ts @@ -248,7 +248,7 @@ export class Account { * or custom inputs. * @returns The transaction. */ - async createAliasOutput( + async createAccountOutput( params?: AccountOutputParams, transactionOptions?: TransactionOptions, ): Promise { diff --git a/bindings/python/tests/test_block.py b/bindings/python/tests/test_block.py index ac4a8c0c99..5e238f8eea 100644 --- a/bindings/python/tests/test_block.py +++ b/bindings/python/tests/test_block.py @@ -1,10 +1,9 @@ # Copyright 2023 IOTA Stiftung # SPDX-License-Identifier: Apache-2.0 +import pytest from typing import get_args from iota_sdk import BasicBlock, BlockType, BlockWrapper, Payload, PayloadType -import pytest - def test_basic_block_with_tagged_data_payload(): block_dict = { diff --git a/bindings/python/tests/test_offline.py b/bindings/python/tests/test_offline.py index 89ce494aea..a4958df0c7 100644 --- a/bindings/python/tests/test_offline.py +++ b/bindings/python/tests/test_offline.py @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 import json -import pytest import unittest +import pytest from iota_sdk import BasicBlock, Client, MnemonicSecretManager, Utils, SecretManager, OutputId, hex_to_utf8, utf8_to_hex, Bip44, CoinType, Irc27Metadata, Irc30Metadata diff --git a/bindings/python/tests/test_output.py b/bindings/python/tests/test_output.py index a3c1c8d592..7a02f0e278 100644 --- a/bindings/python/tests/test_output.py +++ b/bindings/python/tests/test_output.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 from dacite import from_dict -from iota_sdk import BasicOutput, AliasOutput, FoundryOutput, NftOutput, IssuerFeature, MetadataFeature +from iota_sdk import BasicOutput, AccountOutput, FoundryOutput, NftOutput, IssuerFeature, MetadataFeature def test_feature(): diff --git a/sdk/tests/client/node_api/indexer.rs b/sdk/tests/client/node_api/indexer.rs index ce94c2fb9a..2608948554 100644 --- a/sdk/tests/client/node_api/indexer.rs +++ b/sdk/tests/client/node_api/indexer.rs @@ -11,7 +11,7 @@ // AddressUnlockCondition, GovernorAddressUnlockCondition, ImmutableAliasAddressUnlockCondition, // StateControllerAddressUnlockCondition, UnlockCondition, // }, -// AliasId, AliasOutputBuilder, FoundryId, FoundryOutputBuilder, NftId, NftOutputBuilder, SimpleTokenScheme, +// AliasId, AccountOutputBuilder, FoundryId, FoundryOutputBuilder, NftId, NftOutputBuilder, SimpleTokenScheme, // TokenScheme, // }, // }, @@ -32,7 +32,7 @@ // .await?[0]; // let alias_output = -// AliasOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), AliasId::null()) +// AccountOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), AliasId::null()) // .with_state_metadata([1, 2, 3]) // .add_unlock_condition(StateControllerAddressUnlockCondition::new(address)) // .add_unlock_condition(GovernorAddressUnlockCondition::new(address)) @@ -94,7 +94,7 @@ // .await?[0]; // let alias_output_0 = -// AliasOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), AliasId::null()) +// AccountOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), AliasId::null()) // .with_state_metadata([1, 2, 3]) // .add_unlock_condition(StateControllerAddressUnlockCondition::new(address)) // .add_unlock_condition(GovernorAddressUnlockCondition::new(address)) @@ -109,7 +109,7 @@ // let alias_id = AliasId::from(&get_alias_output_id(block.payload().unwrap())?); -// let alias_output_1 = AliasOutputBuilder::from(alias_output_0.as_alias()) +// let alias_output_1 = AccountOutputBuilder::from(alias_output_0.as_alias()) // .with_alias_id(alias_id) // .with_state_index(alias_output_0.as_alias().state_index() + 1) // .with_foundry_counter(alias_output_0.as_alias().foundry_counter() + 1) From b3ff44d20ebc10971163a64cc1deeb782ff53268 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Fri, 20 Oct 2023 19:52:34 +0200 Subject: [PATCH 3/4] Fmt --- bindings/python/tests/test_block.py | 1 + sdk/tests/client/node_api/indexer.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bindings/python/tests/test_block.py b/bindings/python/tests/test_block.py index 5e238f8eea..8d64ec11c9 100644 --- a/bindings/python/tests/test_block.py +++ b/bindings/python/tests/test_block.py @@ -5,6 +5,7 @@ from typing import get_args from iota_sdk import BasicBlock, BlockType, BlockWrapper, Payload, PayloadType + def test_basic_block_with_tagged_data_payload(): block_dict = { "type": 0, diff --git a/sdk/tests/client/node_api/indexer.rs b/sdk/tests/client/node_api/indexer.rs index 2608948554..ef726b8ee9 100644 --- a/sdk/tests/client/node_api/indexer.rs +++ b/sdk/tests/client/node_api/indexer.rs @@ -11,8 +11,8 @@ // AddressUnlockCondition, GovernorAddressUnlockCondition, ImmutableAliasAddressUnlockCondition, // StateControllerAddressUnlockCondition, UnlockCondition, // }, -// AliasId, AccountOutputBuilder, FoundryId, FoundryOutputBuilder, NftId, NftOutputBuilder, SimpleTokenScheme, -// TokenScheme, +// AliasId, AccountOutputBuilder, FoundryId, FoundryOutputBuilder, NftId, NftOutputBuilder, +// SimpleTokenScheme, TokenScheme, // }, // }, // }; @@ -32,8 +32,8 @@ // .await?[0]; // let alias_output = -// AccountOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), AliasId::null()) -// .with_state_metadata([1, 2, 3]) +// AccountOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), +// AliasId::null()) .with_state_metadata([1, 2, 3]) // .add_unlock_condition(StateControllerAddressUnlockCondition::new(address)) // .add_unlock_condition(GovernorAddressUnlockCondition::new(address)) // .finish_output(protocol_parameters.token_supply())?; @@ -94,8 +94,8 @@ // .await?[0]; // let alias_output_0 = -// AccountOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), AliasId::null()) -// .with_state_metadata([1, 2, 3]) +// AccountOutputBuilder::new_with_minimum_storage_deposit(*protocol_parameters.rent_structure(), +// AliasId::null()) .with_state_metadata([1, 2, 3]) // .add_unlock_condition(StateControllerAddressUnlockCondition::new(address)) // .add_unlock_condition(GovernorAddressUnlockCondition::new(address)) // .finish_output(protocol_parameters.token_supply())?; From d4fc8af11821a6ee061581f63d7d25282223cfad Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Sat, 21 Oct 2023 14:41:45 +0200 Subject: [PATCH 4/4] More lints --- bindings/python/tests/test_block.py | 2 +- bindings/python/tests/test_offline.py | 2 +- bindings/python/tests/test_wallet_destroy.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python/tests/test_block.py b/bindings/python/tests/test_block.py index 8d64ec11c9..194c3133e2 100644 --- a/bindings/python/tests/test_block.py +++ b/bindings/python/tests/test_block.py @@ -1,8 +1,8 @@ # Copyright 2023 IOTA Stiftung # SPDX-License-Identifier: Apache-2.0 -import pytest from typing import get_args +import pytest from iota_sdk import BasicBlock, BlockType, BlockWrapper, Payload, PayloadType diff --git a/bindings/python/tests/test_offline.py b/bindings/python/tests/test_offline.py index a4958df0c7..55c95e24f0 100644 --- a/bindings/python/tests/test_offline.py +++ b/bindings/python/tests/test_offline.py @@ -4,7 +4,7 @@ import json import unittest import pytest -from iota_sdk import BasicBlock, Client, MnemonicSecretManager, Utils, SecretManager, OutputId, hex_to_utf8, utf8_to_hex, Bip44, CoinType, Irc27Metadata, Irc30Metadata +from iota_sdk import Client, MnemonicSecretManager, Utils, SecretManager, OutputId, hex_to_utf8, utf8_to_hex, Bip44, CoinType, Irc27Metadata, Irc30Metadata # Read the test vector diff --git a/bindings/python/tests/test_wallet_destroy.py b/bindings/python/tests/test_wallet_destroy.py index 72feaca159..92d7651749 100644 --- a/bindings/python/tests/test_wallet_destroy.py +++ b/bindings/python/tests/test_wallet_destroy.py @@ -2,8 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 import shutil -import pytest import unittest +import pytest from iota_sdk import Wallet, MnemonicSecretManager, CoinType, ClientOptions, WalletError