requestSyncrhoneExtensionEscrow implementation#4
requestSyncrhoneExtensionEscrow implementation#4Gujjar95 wants to merge 3 commits intoNickChapman:masterfrom
Conversation
| return {'error' : ValueError('first parameter must be a valid eth address')} | ||
| ret : List[Any] = [] | ||
| #no idea about address parameter | ||
| ret.append(self._web3Single.toSolidityBytes32(address, extensionParams[0])) |
| from servicesExternal.web3_single import Web3Single | ||
|
|
||
|
|
||
| requestCoreArtifact = Artifacts.requestCoreArtifact |
There was a problem hiding this comment.
you don't need to do this, they're already imported on line 4 from artifacts import *
|
|
||
|
|
||
| requestCoreArtifact = Artifacts.requestCoreArtifact | ||
| requestSynchroneExtensionEscrowArtifact = Artifacts.requestSynchroneExtensionEscrowArtifact |
| class RequestSynchroneExtensionEscrowService: | ||
| def __init__(self): | ||
| pass | ||
| global requestCoreArtifact, requestSynchroneExtensionEscrowArtifact |
There was a problem hiding this comment.
This is likely not needed either.
| pass | ||
| global requestCoreArtifact, requestSynchroneExtensionEscrowArtifact | ||
| self._web3Single = Web3Single.getInstance() | ||
| self._abiRequestCore = requestCoreArtifact.abi |
There was a problem hiding this comment.
The artifacts need to be interacted with like dicts, so you'll need to do requestCoreArtifact['abi']
| 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')} |
There was a problem hiding this comment.
It's strange to return a dictionary like this. Is this what the calling functions are expecting?
There was a problem hiding this comment.
Nick, so should we raise an error here or any other?
| #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)) |
There was a problem hiding this comment.
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 range(1,9) instead of range(8)
| ret.append(self._web3Single.toSolidityBytes32("address", extensionParams[0])) | ||
| for i in range(1,9): | ||
| ret.append(self._web3Single.toSolidityBytes32('bytes32',0)) | ||
| return {'result' : ret} |
There was a problem hiding this comment.
Again with the strange return style, is that what's expected?
|
@Gujjar95 any update on this or would you like me to take care of these changes? |
No description provided.