Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Feb 12, 2024
2 parents 340367d + 7fb722c commit b6d7882
Show file tree
Hide file tree
Showing 36 changed files with 1,126 additions and 403 deletions.
53 changes: 30 additions & 23 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions bindings/core/src/method_handler/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,18 @@ pub(crate) async fn call_client_method_internal(client: &Client, method: ClientM
.get_utxo_changes_full_by_slot_commitment_id(&commitment_id)
.await?,
),
// TODO: this should be renamed to `GetCommitmentBySlot`
// https://github.com/iotaledger/iota-sdk/issues/1921
ClientMethod::GetCommitmentByIndex { slot } => {
Response::SlotCommitment(client.get_slot_commitment_by_slot(slot).await?)
}
// TODO: this should be renamed to `GetUtxoChangesBySlot`
// https://github.com/iotaledger/iota-sdk/issues/1921
ClientMethod::GetUtxoChangesByIndex { slot } => {
Response::UtxoChanges(client.get_utxo_changes_by_slot(slot).await?)
}
// TODO: this should be renamed to `GetUtxoChangesFullBySlot`
// https://github.com/iotaledger/iota-sdk/issues/1921
ClientMethod::GetUtxoChangesFullByIndex { slot } => {
Response::UtxoChangesFull(client.get_utxo_changes_full_by_slot(slot).await?)
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/client/07_get_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
client = Client(nodes=[node_url])

# Fetch a block ID from the node
block_ids = client.get_tips()
block_ids = client.get_issuance().strong_parents
print(f'Block id: {block_ids[0]}')

# Get the metadata for the block
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/examples/client/get_raw_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
client = Client(nodes=[node_url])

# Fetch a block ID from the node
block_id = client.get_tips()[0]
block_id = client.get_issuance().strong_parents[0]
print(f'Block id: {block_id}')

# Get block raw
Expand Down
6 changes: 4 additions & 2 deletions bindings/python/iota_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .common import custom_encoder
from .client.client import Client, NodeIndexerAPI
from .client.common import ClientError
from .client.responses import *
from .client._high_level_api import GenerateAddressesOptions, GenerateAddressOptions
from .utils import Utils
from .wallet.wallet import Wallet, WalletOptions
Expand All @@ -30,16 +31,17 @@
from .types.decayed_mana import *
from .types.event import *
from .types.feature import *
from .types.input import *
from .types.irc_27 import *
from .types.irc_30 import *
from .types.filter_options import *
from .types.input import *
from .types.native_token import *
from .types.network_info import *
from .types.node_info import *
from .types.output import *
from .types.output_data import *
from .types.output_id import *
from .types.output_id_proof import *
from .types.output_metadata import *
from .types.output_params import *
from .types.payload import *
Expand All @@ -48,9 +50,9 @@
from .types.token_scheme import *
from .types.transaction_data import *
from .types.transaction_id import *
from .types.transaction_metadata import *
from .types.transaction_options import *
from .types.transaction_with_metadata import *
from .types.unlock import *
from .types.unlock_condition import *
from .types.utxo_changes import *
from .types.consolidation_params import *
11 changes: 8 additions & 3 deletions bindings/python/iota_sdk/client/_high_level_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
from typing import List, Optional
from dataclasses import dataclass
from abc import ABCMeta, abstractmethod

from iota_sdk.types.block.block import Block
from iota_sdk.types.block.id import BlockId
from iota_sdk.types.common import CoinType, json
from iota_sdk.types.output_metadata import OutputWithMetadata
from iota_sdk.types.output_id import OutputId
from iota_sdk.types.output_metadata import OutputWithMetadata


@json
Expand All @@ -26,7 +27,7 @@ class Range:

@json
@dataclass
class GenerateAddressOptions():
class GenerateAddressOptions:
"""Options for generating an address.
Attributes:
Expand All @@ -39,7 +40,7 @@ class GenerateAddressOptions():

@json
@dataclass
class GenerateAddressesOptions():
class GenerateAddressesOptions:
"""Options for generating addresses.
Attributes:
Expand Down Expand Up @@ -81,6 +82,8 @@ def _call_method(self, name, data=None):
no payload.
"""

# TODO: this should return `List[OutputResponse]`, not `List[OutputWithMetadata]`
# https://github.com/iotaledger/iota-sdk/issues/1921
def get_outputs(
self, output_ids: List[OutputId]) -> List[OutputWithMetadata]:
"""Fetch OutputWithMetadata from provided OutputIds (requests are sent in parallel).
Expand All @@ -96,6 +99,8 @@ def get_outputs(
})
return [OutputWithMetadata.from_dict(o) for o in outputs]

# TODO: this should return `List[OutputResponse]`, not `List[OutputWithMetadata]`
# https://github.com/iotaledger/iota-sdk/issues/1921
def get_outputs_ignore_errors(
self, output_ids: List[OutputId]) -> List[OutputWithMetadata]:
"""Try to get OutputWithMetadata from provided OutputIds.
Expand Down
Loading

0 comments on commit b6d7882

Please sign in to comment.