Skip to content

Commit

Permalink
Fix python SDK lint (#1481)
Browse files Browse the repository at this point in the history
* Fix python SDK lint

* More changes

* Fmt

* More lints
  • Loading branch information
thibault-martinez authored Oct 21, 2023
1 parent 3d1deb9 commit 14e8a4a
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bindings/nodejs/examples/how_tos/account_output/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);

Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/lib/wallet/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class Account {
* or custom inputs.
* @returns The transaction.
*/
async createAliasOutput(
async createAccountOutput(
params?: AccountOutputParams,
transactionOptions?: TransactionOptions,
): Promise<Transaction> {
Expand Down
3 changes: 3 additions & 0 deletions bindings/python/iota_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/tests/test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

from typing import get_args
from iota_sdk import BasicBlock, BlockType, BlockWrapper, Payload, PayloadType
import pytest
from iota_sdk import BasicBlock, BlockType, BlockWrapper, Payload, PayloadType


def test_basic_block_with_tagged_data_payload():
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/tests/test_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# SPDX-License-Identifier: Apache-2.0

import json
import pytest
import unittest
from iota_sdk import BasicBlock, Client, MnemonicSecretManager, Utils, SecretManager, OutputId, hex_to_utf8, utf8_to_hex, Bip44, CoinType, Irc27Metadata, Irc30Metadata
import pytest
from iota_sdk import Client, MnemonicSecretManager, Utils, SecretManager, OutputId, hex_to_utf8, utf8_to_hex, Bip44, CoinType, Irc27Metadata, Irc30Metadata


# Read the test vector
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/tests/test_wallet_destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
14 changes: 7 additions & 7 deletions sdk/tests/client/node_api/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// AddressUnlockCondition, GovernorAddressUnlockCondition, ImmutableAliasAddressUnlockCondition,
// StateControllerAddressUnlockCondition, UnlockCondition,
// },
// AliasId, AliasOutputBuilder, FoundryId, FoundryOutputBuilder, NftId, NftOutputBuilder, SimpleTokenScheme,
// TokenScheme,
// AliasId, AccountOutputBuilder, FoundryId, FoundryOutputBuilder, NftId, NftOutputBuilder,
// SimpleTokenScheme, TokenScheme,
// },
// },
// };
Expand All @@ -32,8 +32,8 @@
// .await?[0];

// let alias_output =
// AliasOutputBuilder::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())?;
Expand Down Expand Up @@ -94,8 +94,8 @@
// .await?[0];

// let alias_output_0 =
// AliasOutputBuilder::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())?;
Expand All @@ -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)
Expand Down

0 comments on commit 14e8a4a

Please sign in to comment.