-
Notifications
You must be signed in to change notification settings - Fork 5
requestSyncrhoneExtensionEscrow implementation #4
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,13 +6,33 @@ | |
| from servicesCore.requestCore_service import RequestCoreService | ||
| from servicesExternal.web3_single import Web3Single | ||
|
|
||
|
|
||
| requestCoreArtifact = Artifacts.requestCoreArtifact | ||
| requestSynchroneExtensionEscrowArtifact = Artifacts.requestSynchroneExtensionEscrowArtifact | ||
|
Owner
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. Same for this line as well. |
||
| class RequestSynchroneExtensionEscrowService: | ||
| def __init__(self): | ||
| pass | ||
| global requestCoreArtifact, requestSynchroneExtensionEscrowArtifact | ||
|
Owner
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. This is likely not needed either. |
||
| self._web3Single = Web3Single.getInstance() | ||
| self._abiRequestCore = requestCoreArtifact.abi | ||
|
Owner
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 |
||
| self._requestCoreServices = RequestCoreService() | ||
| networkName = self._web3Single.networkName | ||
| self._abiSynchroneExtensionEscrow = requestSynchroneExtensionEscrowArtifact.abi | ||
| if not requestSynchroneExtensionEscrowArtifact[networkName] : | ||
| raise ValueError('Escrow Artifact no configuration for network: ' + networkName) | ||
| self._addressSynchroneExtensionEscrow = requestSynchroneExtensionEscrowArtifact.networks[networkName].address | ||
| self._instanceSynchroneExtensionEscrow = self._web3Single.web3.eth.Contract( | ||
| self._abiSynchroneExtensionEscrow, | ||
| self._addressSynchroneExtensionEscrow) | ||
|
|
||
| def parseParameters(self, extensionParams: List[Any]) -> Any: | ||
| pass | ||
| if not extensionParams or not self._web3Single.isAddressNoChecksum(extensionParams[0]): | ||
| return {'error' : ValueError('first parameter must be a valid eth address')} | ||
|
Owner
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. It's strange to return a dictionary like this. Is this what the calling functions are expecting?
Contributor
Author
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. Nick, so should we raise an error here or any other? |
||
| ret : List[Any] = [] | ||
| #no idea about address parameter | ||
| ret.append(self._web3Single.toSolidityBytes32("address", extensionParams[0])) | ||
| for i in range(1,9): | ||
| ret.append(self._web3Single.toSolidityBytes32('bytes32',0)) | ||
|
Owner
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. This appends the same thing 8 times, is there a reason that it's the same thing every time and is there a reason you're doing |
||
| return {'result' : ret} | ||
|
Owner
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. Again with the strange return style, is that what's expected? |
||
|
|
||
|
|
||
| def releaseToPayeeAction(self, requestId: str, options: Any = None): | ||
| pass | ||
|
|
||
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.
you don't need to do this, they're already imported on line 4
from artifacts import *