Skip to content

Commit

Permalink
Fix Block::from_dict()
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoralf-M committed Feb 12, 2024
1 parent 0683d80 commit 802ec74
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

6 changes: 5 additions & 1 deletion bindings/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security -->

## 1.1.3 - 202Y-MM-DD
## 1.1.3 - 2024-02-12

### Added

Expand All @@ -28,6 +28,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `NodeInfoProtocol.belowMaxDepth`;
- `{NodeInfoProtocol, RentStructure}::as_dict()`;

### Fixed

- `Block::from_dict()`;

## 1.1.2 - 2023-12-01

### Added
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iota-sdk-python"
version = "1.1.2"
version = "1.1.3"
authors = ["IOTA Stiftung"]
edition = "2021"
description = "Python bindings for the IOTA SDK library"
Expand Down
7 changes: 5 additions & 2 deletions bindings/python/iota_sdk/types/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from dataclasses import dataclass
from typing import List, Optional, Union, Dict
from enum import Enum
from dacite import from_dict
from iota_sdk.types.common import HexStr
from iota_sdk.types.payload import TaggedDataPayload, TransactionPayload, MilestonePayload
from iota_sdk.utils import Utils
Expand Down Expand Up @@ -38,7 +37,11 @@ def from_dict(cls, block_dict: Dict) -> Block:
An instance of the `Block` class.
"""
return from_dict(Block, block_dict)
obj = cls.__new__(cls)
super(Block, obj).__init__()
for k, v in block_dict.items():
setattr(obj, k, v)
return obj

def id(self) -> HexStr:
"""Returns the block ID as a hexadecimal string.
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_py_version_cfgs():

setup(
name="iota_sdk",
version="1.1.2",
version="1.1.3",
classifiers=[
"License :: SPDX-License-Identifier :: Apache-2.0",
"Intended Audience :: Developers",
Expand Down

0 comments on commit 802ec74

Please sign in to comment.