-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.0' into feat/btree-sets
- Loading branch information
Showing
26 changed files
with
500 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2023 IOTA Stiftung | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
from dataclasses import dataclass, field | ||
from typing import List, Optional | ||
from iota_sdk.types.block.block import Block, BlockType | ||
from iota_sdk.types.common import HexStr, json | ||
from iota_sdk.types.payload import PayloadUnion | ||
|
||
|
||
@json | ||
@dataclass | ||
class BasicBlock(Block): | ||
"""A `BasicBlock` is the most common type of block used to issue various kinds of payloads such as transactions | ||
at the cost of burning Mana. | ||
Attributes: | ||
strong_parents: Blocks that are strongly directly approved. | ||
weak_parents: Blocks that are weakly directly approved. | ||
shallow_like_parents: Blocks that are directly referenced to adjust opinion. | ||
max_burned_mana: The amount of Mana the Account identified by the IssuerId is at most willing to burn for this block. | ||
payload: The optional payload of this block. | ||
""" | ||
strong_parents: List[HexStr] | ||
weak_parents: List[HexStr] | ||
shallow_like_parents: List[HexStr] | ||
max_burned_mana: str | ||
payload: Optional[PayloadUnion] = None | ||
type: int = field( | ||
default_factory=lambda: BlockType.Basic, | ||
init=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2023 IOTA Stiftung | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
from enum import IntEnum | ||
from dataclasses import dataclass | ||
from iota_sdk.types.common import json | ||
|
||
|
||
class BlockType(IntEnum): | ||
"""Block types. | ||
Attributes: | ||
Basic (0): A Basic Block. | ||
Validation (1): A Validation Block. | ||
""" | ||
Basic = 0 | ||
Validation = 1 | ||
|
||
|
||
@json | ||
@dataclass | ||
class Block: | ||
"""Base class for blocks. | ||
""" | ||
type: int |
Oops, something went wrong.