-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add transaction receipts to responses #145
Add transaction receipts to responses #145
Conversation
managers/asset-operations-manager.js
Outdated
transactionHash: receipt.transactionHash, | ||
status: receipt.status, | ||
}; | ||
return receipt; |
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.
We shouldn't change the way returned object looks like, it would be a breaking change otherwise. I suggest we just add additional field operation
managers/asset-operations-manager.js
Outdated
transactionHash: receipt.transactionHash, | ||
status: receipt.status, | ||
}; | ||
return receipt; |
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.
return receipt; | |
return { | |
operation: receipt, | |
transactionHash: receipt.transactionHash, | |
status: receipt.status, | |
}; |
@@ -285,7 +285,7 @@ class BlockchainServiceBase { | |||
data: { tokenId }, | |||
}); | |||
|
|||
return tokenId; | |||
return [tokenId, receipt]; |
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.
Let's return an object to avoid mistakes in the future
return [tokenId, receipt]; | |
return { tokenId, receipt }; |
managers/asset-operations-manager.js
Outdated
tokenId = await this.blockchainService.createAsset( | ||
let receipt; | ||
if (paranetUAL == null) { | ||
[tokenId, receipt] = await this.blockchainService.createAsset( |
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.
I would suggest returning object here, then destructuring would look like that:
[tokenId, receipt] = await this.blockchainService.createAsset( | |
({ tokenId, receipt } = await this.blockchainService.createAsset( |
managers/asset-operations-manager.js
Outdated
@@ -352,7 +344,7 @@ class AssetOperationsManager { | |||
); |
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.
); | |
)); |
managers/asset-operations-manager.js
Outdated
); | ||
return { | ||
UAL, | ||
publicAssertionId, | ||
operation: getOperationStatusObject(operationResult, operationId), | ||
operation: { | ||
updateKnowledgeAssetReceipt: receipt, |
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.
updateKnowledgeAssetReceipt: receipt, | |
updateKnowledgeAsset: receipt, |
managers/asset-operations-manager.js
Outdated
operation: getOperationStatusObject(operationResult, operationId), | ||
operation: { | ||
updateKnowledgeAssetReceipt: receipt, | ||
localStore: getOperationStatusObject(localStoreOperationResult, UpdateOperationId), |
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.
localStore: getOperationStatusObject(localStoreOperationResult, UpdateOperationId), | |
localStore: getOperationStatusObject(localStoreOperationResult, updateOperationId), |
managers/asset-operations-manager.js
Outdated
status: getOperationStatusObject({ status: 'COMPLETED' }, null), | ||
cancelKnowledgeAssetUpdateReceipt: receipt, | ||
}, | ||
cancelAssetUpdateReceipt: receipt, |
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.
We already have it inside operation
cancelAssetUpdateReceipt: receipt, |
managers/asset-operations-manager.js
Outdated
|
||
return { | ||
UAL, | ||
operation: getOperationStatusObject({ status: 'COMPLETED' }, null), | ||
operation: { | ||
status: getOperationStatusObject({ status: 'COMPLETED' }, null), |
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.
This on is not needed, since we only have 1 operation in this function, I would just return operation: receipt
@@ -53,6 +53,7 @@ class ParanetOperationsManager { | |||
|
|||
return { | |||
paranetUAL: UAL, | |||
createParanetReceipt: receipt |
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.
createParanetReceipt: receipt | |
operation: receipt |
…ransaction-receipts-to-responses
Was able to test the following methods:
Could not test these methods: