-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: add BlockIssuanceCreditContextInput (#1193)
* Python: add BlockIssuanceCreditInput, fixes * Add ContextInput base class
- Loading branch information
Showing
4 changed files
with
41 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright 2023 IOTA Stiftung | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
from dataclasses import dataclass, field | ||
from enum import IntEnum | ||
from iota_sdk.types.common import HexStr, json | ||
|
||
|
||
class ContextInputType(IntEnum): | ||
"""Context input types. | ||
""" | ||
BlockIssuanceCredit = 1 | ||
|
||
|
||
@json | ||
@dataclass | ||
class ContextInput(): | ||
"""Base class for context inputs. | ||
""" | ||
type: int | ||
|
||
|
||
@json | ||
@dataclass | ||
class BlockIssuanceCreditContextInput(ContextInput): | ||
"""A Block Issuance Credit (BIC) Context Input provides the VM with context for the value of | ||
the BIC vector of a specific slot. | ||
""" | ||
account_id: HexStr | ||
type: int = field( | ||
default_factory=lambda: int( | ||
ContextInputType.BlockIssuanceCredit), | ||
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