Skip to content

Commit

Permalink
Merge branch '2.0' into merge-1.1-into-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandcoats authored Sep 12, 2023
2 parents 7b40245 + ae03064 commit 1880194
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
17 changes: 12 additions & 5 deletions bindings/python/iota_sdk/types/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ class Block:
Attributes:
protocol_version: The protocol version with which this block was issued.
parents: The parents of this block.
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.
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.
"""

protocol_version: int
parents: List[HexStr]
strong_parents: List[HexStr]
weak_parents: List[HexStr]
shallow_like_parents: List[HexStr]
burned_mana: str
payload: Optional[TaggedDataPayload |
TransactionPayload] = None
Expand Down Expand Up @@ -105,7 +108,9 @@ class BlockMetadata:
Attributes:
block_id: The id of the block.
parents: The parents of the block.
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.
is_solid: Whether the block is solid.
referenced_by_milestone_index: The milestone index referencing the block.
milestone_index: The milestone index if the block contains a milestone payload.
Expand All @@ -115,7 +120,9 @@ class BlockMetadata:
should_reattach: Whether the block should be reattached.
"""
block_id: HexStr
parents: List[HexStr]
strong_parents: List[HexStr]
weak_parents: List[HexStr]
shallow_like_parents: List[HexStr]
is_solid: bool
referenced_by_milestone_index: Optional[int] = None
milestone_index: Optional[int] = None
Expand Down
4 changes: 3 additions & 1 deletion bindings/python/iota_sdk/types/block_builder_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ class BlockBuilderOptions:
custom_remainder_address: Optional[str] = None
tag: Optional[HexStr] = None
data: Optional[HexStr] = None
parents: Optional[List[HexStr]] = None
strong_parents: Optional[List[HexStr]] = None
weak_parents: Optional[List[HexStr]] = None
shallow_like_parents: Optional[List[HexStr]] = None
burn: Optional[Burn] = None
13 changes: 13 additions & 0 deletions bindings/python/iota_sdk/types/context_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ContextInputType(IntEnum):
"""Context input types.
"""
BlockIssuanceCredit = 1
Reward = 2


@json
Expand All @@ -32,3 +33,15 @@ class BlockIssuanceCreditContextInput(ContextInput):
default_factory=lambda: int(
ContextInputType.BlockIssuanceCredit),
init=False)


@json
@dataclass
class RewardContextInput(ContextInput):
"""A Reward Context Input indicates which transaction Input is claiming Mana rewards.
"""
index: int
type: int = field(
default_factory=lambda: int(
ContextInputType.Reward),
init=False)
Loading

0 comments on commit 1880194

Please sign in to comment.