-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] #132: refactor codegen for enum
- Loading branch information
Showing
99 changed files
with
1,047 additions
and
418 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
{ | ||
"TORII_API_URL": "http://iroha0:8080", | ||
"ACCOUNT_ID": { | ||
"name": "alice", | ||
"domain_id": { | ||
"name": "wonderland" | ||
} | ||
"PUBLIC_KEY": "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0", | ||
"PRIVATE_KEY": { | ||
"digest_function": "ed25519", | ||
"payload": "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0" | ||
}, | ||
"ACCOUNT_ID": "alice@wonderland", | ||
"BASIC_AUTH": { | ||
"web_login": "mad_hatter", | ||
"password": "ilovetea" | ||
}, | ||
"PUBLIC_KEY": "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0", | ||
"PRIVATE_KEY": { | ||
"digest_function": "ed25519", | ||
"payload": "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0" | ||
"TORII_API_URL": "http://127.0.0.1:8080", | ||
"TORII_TELEMETRY_URL": "http://127.0.0.1:8180", | ||
"TRANSACTION_TIME_TO_LIVE_MS": 100000, | ||
"TRANSACTION_STATUS_TIMEOUT_MS": 15000, | ||
"TRANSACTION_LIMITS": { | ||
"max_instruction_number": 4096, | ||
"max_wasm_size_bytes": 4194304 | ||
}, | ||
"LOGGER_CONFIGURATION": {} | ||
"ADD_TRANSACTION_NONCE": 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
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
Duration = make_tuple("Duration", [int, int]) | ||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
from ..iroha2 import * | ||
from .rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from .rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
from ...rust import Enum, make_struct, make_tuple, Dict | ||
BlockHeader = make_struct("BlockHeader", [("timestamp", int), ("consensus_estimation", int), ("height", int), ("previous_block_hash", "iroha_crypto.hash.HashOf"), ("transactions_hash", "iroha_crypto.hash.HashOf"), ("rejected_transactions_hash", "iroha_crypto.hash.HashOf"), ("view_change_proofs", "iroha_core.sumeragi.view_change.ProofChain"), ("invalidated_blocks_hashes", list), ("genesis_topology", "iroha_core.sumeragi.network_topology.Topology")]) | ||
|
||
from ...rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
BlockHeader = make_struct("BlockHeader", [("timestamp", int), ("consensus_estimation", int), ("height", int), ("view_change_index", int), ("previous_block_hash", "iroha_crypto.hash.HashOf"), ("transactions_hash", "iroha_crypto.hash.HashOf"), ("rejected_transactions_hash", "iroha_crypto.hash.HashOf"), ("genesis_topology", "iroha_core.sumeragi.network_topology.Topology")]) | ||
|
||
CandidateBlock = make_struct("CandidateBlock", [("header", "iroha_core.block.BlockHeader"), ("rejected_transactions", list), ("transactions", list), ("signatures", "iroha_crypto.signature.SignaturesOf"), ("event_recommendations", list)]) | ||
|
||
CommittedBlock = make_struct("CommittedBlock", [("header", "iroha_core.block.BlockHeader"), ("rejected_transactions", list), ("transactions", list), ("event_recommendations", list), ("signatures", "iroha_crypto.signature.SignaturesOf")]) | ||
|
||
ValidBlock = make_struct("ValidBlock", [("header", "iroha_core.block.BlockHeader"), ("rejected_transactions", list), ("transactions", list), ("signatures", list), ("event_recommendations", list)]) | ||
VersionedCandidateBlock = make_enum("VersionedCandidateBlock", [("V1", get_class("iroha_core.block.CandidateBlock"))], typing.Union[get_class("iroha_core.block.CandidateBlock")]) | ||
|
||
VersionedCommittedBlock = make_enum("VersionedCommittedBlock", [("V1", get_class("iroha_core.block.CommittedBlock"))], typing.Union[get_class("iroha_core.block.CommittedBlock")]) | ||
|
||
VersionedCommittedBlock = Enum[("V1", "iroha_core.block.CommittedBlock")] | ||
VersionedValidBlock = Enum[("V1", "iroha_core.block.ValidBlock")] | ||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
from ....rust import Enum, make_struct, make_tuple, Dict | ||
BlockPublisherMessage = Enum[("SubscriptionAccepted", type(None)), ("Block", "iroha_core.block.VersionedCommittedBlock")] | ||
BlockSubscriberMessage = Enum[("SubscriptionRequest", int), ("BlockReceived", type(None))] | ||
VersionedBlockPublisherMessage = Enum[("V1", "iroha_core.block.stream.BlockPublisherMessage")] | ||
VersionedBlockSubscriberMessage = Enum[("V1", "iroha_core.block.stream.BlockSubscriberMessage")] | ||
|
||
from ....rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
BlockMessage = make_tuple("BlockMessage", ["iroha_core.block.VersionedCommittedBlock"]) | ||
BlockSubscriptionRequest = make_tuple("BlockSubscriptionRequest", [int]) | ||
VersionedBlockMessage = make_enum("VersionedBlockMessage", [("V1", get_class("iroha_core.block.stream.BlockMessage"))], typing.Union[get_class("iroha_core.block.stream.BlockMessage")]) | ||
|
||
VersionedBlockSubscriptionRequest = make_enum("VersionedBlockSubscriptionRequest", [("V1", get_class("iroha_core.block.stream.BlockSubscriptionRequest"))], typing.Union[get_class("iroha_core.block.stream.BlockSubscriptionRequest")]) | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
from ...rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ...rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
GenesisTransaction = make_struct("GenesisTransaction", [("isi", list)]) | ||
|
||
RawGenesisBlock = make_struct("RawGenesisBlock", [("transactions", list)]) | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ...rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ...rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ....rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ....rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
from .....rust import Enum, make_struct, make_tuple, Dict | ||
FindError = Enum[("Asset", "iroha_data_model.asset.Id"), ("AssetDefinition", "iroha_data_model.asset.DefinitionId"), ("Account", "iroha_data_model.account.Id"), ("Domain", "iroha_data_model.domain.Id"), ("MetadataKey", "iroha_data_model.name.Name"), ("Block", "iroha_crypto.hash.HashOf"), ("Transaction", "iroha_crypto.hash.HashOf"), ("Context", str), ("Peer", "iroha_data_model.peer.Id"), ("Trigger", "iroha_data_model.trigger.Id"), ("Role", "iroha_data_model.role.Id"), ("PermissionTokenDefinition", "iroha_data_model.permissions.Id")] | ||
|
||
from .....rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
FindError = make_enum("FindError", [("Asset", get_class("iroha_data_model.asset.Id")), ("AssetDefinition", get_class("iroha_data_model.asset.DefinitionId")), ("Account", get_class("iroha_data_model.account.Id")), ("Domain", get_class("iroha_data_model.domain.Id")), ("MetadataKey", get_class("iroha_data_model.name.Name")), ("Block", get_class("iroha_crypto.hash.HashOf")), ("Transaction", get_class("iroha_crypto.hash.HashOf")), ("Context", get_class(str)), ("Peer", get_class("iroha_data_model.peer.Id")), ("Trigger", get_class("iroha_data_model.trigger.Id")), ("Role", get_class("iroha_data_model.role.Id")), ("PermissionTokenDefinition", get_class("iroha_data_model.permission.token.Id")), ("Validator", get_class("iroha_data_model.permission.validator.Id"))], typing.Union[get_class("iroha_data_model.asset.Id"), get_class("iroha_data_model.asset.DefinitionId"), get_class("iroha_data_model.account.Id"), get_class("iroha_data_model.domain.Id"), get_class("iroha_data_model.name.Name"), get_class("iroha_crypto.hash.HashOf"), get_class("iroha_crypto.hash.HashOf"), get_class(str), get_class("iroha_data_model.peer.Id"), get_class("iroha_data_model.trigger.Id"), get_class("iroha_data_model.role.Id"), get_class("iroha_data_model.permission.token.Id"), get_class("iroha_data_model.permission.validator.Id")]) | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
from .....rust import Enum, make_struct, make_tuple, Dict | ||
Error = Enum[("Decode", "iroha_version.error.Error"), ("Signature", str), ("Permission", str), ("Evaluate", str), ("Find", "iroha_core.smartcontracts.isi.error.FindError"), ("Conversion", str), ("Unauthorized", type(None))] | ||
|
||
from .....rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
Error = make_enum("Error", [("Decode", get_class("iroha_version.error.Error")), ("Signature", get_class(str)), ("Permission", get_class(str)), ("Evaluate", get_class(str)), ("Find", get_class("iroha_core.smartcontracts.isi.error.FindError")), ("Conversion", get_class(str)), ("Unauthorized", get_class(type(None)))], typing.Union[get_class("iroha_version.error.Error"), get_class(str), get_class(str), get_class(str), get_class("iroha_core.smartcontracts.isi.error.FindError"), get_class(str), get_class(type(None))]) | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ...rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ...rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
from ....rust import Enum, make_struct, make_tuple, Dict | ||
Topology = make_struct("Topology", [("sorted_peers", list), ("at_block", "iroha_crypto.hash.HashOf"), ("view_change_proofs", "iroha_core.sumeragi.view_change.ProofChain")]) | ||
|
||
from ....rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
Topology = make_struct("Topology", [("sorted_peers", list), ("at_block", "iroha_crypto.hash.HashOf")]) | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
from ..rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ..rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
PublicKey = make_struct("PublicKey", [("digest_function", str), ("payload", list)]) | ||
|
||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
from ...rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ...rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
Hash = make_tuple("Hash", [list]) | ||
HashOf = make_tuple("HashOf", ["iroha_crypto.hash.Hash"]) | ||
SelfResolvingTypeVar.resolve_all() |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
from ...rust import Enum, make_struct, make_tuple, Dict | ||
|
||
from ...rust import make_enum, make_struct, make_tuple, SelfResolvingTypeVar, Dict | ||
import typing | ||
|
||
SelfResolvingTypeVar.resolve_all() |
Oops, something went wrong.