-
Notifications
You must be signed in to change notification settings - Fork 513
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
Changes in Endorser Protocol #1134
Changes in Endorser Protocol #1134
Conversation
Taking latest changes done till EOD 01/05/2021
…o save record in author's wallet. Signed-off-by: Harsh Multani <harsh.multani@ayanworks.com>
Codecov Report
@@ Coverage Diff @@
## main #1134 +/- ##
==========================================
- Coverage 98.68% 98.50% -0.19%
==========================================
Files 450 452 +2
Lines 24784 24855 +71
==========================================
+ Hits 24459 24484 +25
- Misses 325 371 +46 |
Hi @HarshMultani-AyanWorks , it's hard to tell from the code, but the default behaviour should be that the Author writes the transaction to the ledger and updates the schema/cred def non-secrets record to their own wallet. There should be an option (maybe a new parameter in the |
Signed-off-by: Harsh Multani <harsh.multani@ayanworks.com>
Signed-off-by: Harsh Multani <harsh.multani@ayanworks.com>
…t-python into hyperledger-main Signed-off-by: Harsh Multani <harsh.multani@ayanworks.com>
…for ack message. Signed-off-by: Harsh Multani <harsh.multani@ayanworks.com>
Signed-off-by: Harsh Multani <harsh.multani@ayanworks.com>
Hi @ianco, I checked and tested the code, the author and endorser, both can invoke the endpoint to write the transaction to the ledger. However, the transaction is written to the ledger from the author's agent and so the records are being stored in author's wallet. |
|
||
from ...handlers import transaction_acknowledgement_handler as test_module | ||
from ...messages.transaction_acknowledgement import TransactionAcknowledgement | ||
from ......connections.models.conn_record import ConnRecord |
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.
There is an order to follow, for future reference:
- import native package[s]
- one blank line
- from native package[s] import item[s]
- one blank line
- import third party package[s]
- one blank line
- from third party package[s] import item[s]
- one blank line
- from relative package[s] import item[s]: farthest to closest, one blank line between levels
- alphabetical order within each grouping above.
So "from ......connections.models.conn_record ..." belongs at line 6.
- from farthest to closest
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.
import logging | ||
import uuid | ||
from asyncio import shield |
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.
So this would be:
import json
import logging
import uuid
from asyncio import shield
from time import time
from ....connections.models.conn_record import ConnRecord
from ....core.error import BaseError
from ....core.profile import ProfileSession
from ....indy.issuer import IndyIssuerError
from ....ledger.base import BaseLedger
from ....ledger.error import LedgerError
from ....messaging.credential_definitions.util import CRED_DEF_SENT_RECORD_TYPE
from ....messaging.schemas.util import SCHEMA_SENT_RECORD_TYPE
from ....storage.base import StorageRecord
from ....storage.error import StorageNotFoundError
from ....transport.inbound.receipt import MessageReceipt
from .messages.cancel_transaction import CancelTransaction
from .messages.endorsed_transaction_response import EndorsedTransactionResponse
from .messages.refused_transaction_response import RefusedTransactionResponse
from .messages.transaction_acknowledgement import TransactionAcknowledgement
from .messages.transaction_job_to_send import TransactionJobToSend
from .messages.transaction_request import TransactionRequest
from .messages.transaction_resend import TransactionResend
from .models.transaction_record import TransactionRecord
from .transaction_jobs import TransactionJob
It would be around this many imports that adding another one starts to risk duplication, if they're out of order.
@@ -1,4 +1,5 @@ | |||
import uuid | |||
import json |
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.
flip them
@@ -16,6 +17,15 @@ | |||
from ..transaction_jobs import TransactionJob | |||
|
|||
from ..messages.transaction_request import TransactionRequest | |||
from ..messages.transaction_acknowledgement import TransactionAcknowledgement | |||
from ..transaction_jobs import TransactionJob | |||
from .....ledger.base import BaseLedger |
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.
... see? New code duplicates the existing TransactionJob import. Imports need sorting.
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.
apart from gory imports, this looks good
Taking latest changes done till EOD - 10/05/21
Signed-off-by: Harsh Multani <harsh.multani@ayanworks.com>
Could you merge this with main? Then I'll merge it. It might take some manual edits - main has been in significant churn. |
This is a WIP pull request, and it covers the changes in endorser protocol for issues defined in