-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[INDY-1173] add POOL_RESTART handling #582
Merged
andkononykhin
merged 25 commits into
hyperledger:master
from
Toktar:story-1173-add-command-to-restart-pool
Apr 17, 2018
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
bf29651
INDY-1173: added ActionResult
Toktar fc53001
Merge branch 'master' of https://github.com/hyperledger/indy-plenum i…
Toktar 682f54c
INDY-1173: Refactoring POOL_RESTART
Toktar 0fdf438
INDY-1173: Bagfix POOL_RESTART
Toktar 0ae333a
INDY-1173: refactoring
Toktar a3a7058
INDY-1173: refactoring
Toktar c432a8e
INDY-1173: refactoring
Toktar f8cfb54
INDY-1173: refactoring
Toktar fb9d395
Merge branch 'master' of https://github.com/hyperledger/indy-plenum i…
Toktar cf14932
INDY-1173: Refactoring code style
Toktar de736d3
INDY-1173: fixing problem after merge
Toktar d1b5502
INDY-1173: fixed bug in a register_req_handler
Toktar 3cc6b12
Merge branch 'story-1173-add-command-to-restart-pool' of https://gith…
Toktar 1503fff
INDY-1173: fixed code style in the node
Toktar a754c11
Merge branch 'master' of https://github.com/hyperledger/indy-plenum i…
Toktar 25787cd
INDY-1173: Added implementation of abstract methods
Toktar 5f07ea2
INDY-1173: fixed code style
Toktar c41c470
INDY-1173: fixed problems after merge
Toktar 0a0cc96
INDY-1173: refactoring node
Toktar b89b699
INDY-1173:refactoring
Toktar 8e501a2
INDY-1173:refactoring
Toktar 007cc51
INDY-1173: refactoring
Toktar aa08fd5
Merge branch 'master' of https://github.com/hyperledger/indy-plenum i…
Toktar 5605a5d
INDY-1184: bugfix
Toktar 427e1f5
Merge branch 'master' of https://github.com/hyperledger/indy-plenum i…
Toktar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
from typing import TypeVar, NamedTuple | ||
|
||
from plenum.common.constants import NOMINATE, BATCH, REELECTION, PRIMARY, BLACKLIST, REQACK, REQNACK, REJECT, \ | ||
POOL_LEDGER_TXNS, ORDERED, PROPAGATE, PREPREPARE, PREPARE, COMMIT, CHECKPOINT, THREE_PC_STATE, CHECKPOINT_STATE, \ | ||
REPLY, INSTANCE_CHANGE, LEDGER_STATUS, CONSISTENCY_PROOF, CATCHUP_REQ, CATCHUP_REP, VIEW_CHANGE_DONE, CURRENT_STATE, \ | ||
MESSAGE_REQUEST, MESSAGE_RESPONSE, OBSERVED_DATA, BATCH_COMMITTED | ||
from plenum.common.constants import NOMINATE, BATCH, REELECTION, PRIMARY, \ | ||
BLACKLIST, REQACK, REQNACK, REJECT, \ | ||
POOL_LEDGER_TXNS, ORDERED, PROPAGATE, PREPREPARE, PREPARE, COMMIT, \ | ||
CHECKPOINT, THREE_PC_STATE, CHECKPOINT_STATE, \ | ||
REPLY, INSTANCE_CHANGE, LEDGER_STATUS, CONSISTENCY_PROOF, CATCHUP_REQ, \ | ||
CATCHUP_REP, VIEW_CHANGE_DONE, CURRENT_STATE, \ | ||
MESSAGE_REQUEST, MESSAGE_RESPONSE, OBSERVED_DATA, BATCH_COMMITTED, \ | ||
ACTION_RESULT | ||
from plenum.common.messages.client_request import ClientMessageValidator | ||
from plenum.common.messages.fields import NonNegativeNumberField, IterableField, \ | ||
SerializedValueField, SignatureField, TieAmongField, AnyValueField, RequestIdentifierField, TimestampField, \ | ||
|
@@ -215,6 +219,19 @@ class Reply(MessageBase): | |
) | ||
|
||
|
||
class ActionResult(MessageBase): | ||
typename = ACTION_RESULT | ||
schema = ( | ||
(f.IDENTIFIER.nm, AnyValueField()), | ||
(f.REQ_ID.nm, AnyValueField()), | ||
(f.SIG.nm, AnyValueField()), | ||
(f.OPERATION.nm, AnyValueField()), | ||
(f.PROTOCOL_VERSION.nm, AnyValueField()), | ||
(f.IS_SUCCESS.nm, AnyValueField()), | ||
(f.MSG.nm, AnyValueField(optional=True, nullable=True)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list of keys of
|
||
) | ||
|
||
|
||
class InstanceChange(MessageBase): | ||
typename = INSTANCE_CHANGE | ||
schema = ( | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a subclass of MessageBase is not needed. Actually
FieldValidator
and its subclasses (MessageBase
is one of them) are used for validation against schemas. NowActionResult
is not used in any schemas sinceReply.result
is defined asAnyValueField
.Moreover,
Reply.result
for an action should be just a dictionary with the specific fields, it should not be a simple class, because it must be transferred via network as a dictionary. For example, seeNode.handle_get_txn_req
- just a dictionary is used asReply.result
. (If you saw atMessageBase
subclasses, please note thatMessageBase
is a subclass ofMapping
, soMessageBase
provides conversion to a dictionary. But in our case we should use just a dictionary because we need not validation facilities for the reply content.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ActionResult should be a dictionary and shouldn't contains fields. Do we need this class? Can we remove it? At the time of the Reply creation, we will just put the dictionary with keys and values from the next comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should remove this class and put the dictionary as
result
toReply
.