Skip to content

Commit

Permalink
Merge pull request #8 from balsulami/master
Browse files Browse the repository at this point in the history
servicesExtensions implementation.
  • Loading branch information
NickChapman authored Jan 26, 2018
2 parents 3718ea5 + ac27dab commit bd9db00
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 bd9db00

Please sign in to comment.