Skip to content

Commit

Permalink
servicesExtensions implementation. It's almost identical to servicesC…
Browse files Browse the repository at this point in the history
…ontracts.
  • Loading branch information
balsulami committed Jan 25, 2018
1 parent cb77e4c commit ac27dab
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions servicesExtensions.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
from typing import Any, Union

from artifacts import *

from servicesExtensions.requestSyncrhoneExtensionEscrow_service import RequestSynchroneExtensionEscrowService

def getServiceFromAddress(address: str) -> Union[RequestSynchroneExtensionEscrowService, None]:
"""
Returns the service of a corresponding extension contract address
:param address: The address of the extension contract
:return: The service object or None if not found
:param address:
The address of the currency contract
:return
The service object or None if not found
"""
pass
if not address:
return None
if isThisArtifact(requestSynchroneExtensionEscrowArtifact, address):
return RequestSynchroneExtensionEscrowService()

def isThisArtifact(artifact: Any, address: str) -> bool:
"""
TODO: Fill out a description of what this does, no notes in RequestNetwork.js repo
:param artifact:
:param address:
:return:
return True if any address in the network is sanitized address, otherwise it returns False
:param artifact:
RequestNetwork Artifact to use in its interactions with the Ethereum network
:param address:
The address of the currency contract
"""
pass
if not address:
return False
sanitizedAdress = address.lower()
for network in artifact["networks"].values():
if 'address' in network and network['address'].lower() == sanitizedAdress:
return True
return False

0 comments on commit ac27dab

Please sign in to comment.