model/transaction/Appeal.py
def import_dict(transaction: dict) -> Optional[Appeal]:
        """Returns an instance of Appeal object
        based on it's dictionary version"""
        
        keys = ["sender", "verdict", "signature"]
        if any([not key in keys for key in transaction.keys()]):
            print("Invalid transaction: Keys missing")
            return None

        try:
            sender = ID(**transaction["sender"])
        except TypeError:
            print("Invalid transaction: Invalid sender ID")
            return None
        
        verdict = Verdict.import_dict(transaction["verdict"])
        if verdict is None:
            print("Invalid transaction: Verdict must be valid")
            return None

        return Appeal(sender, verdict, transaction["signature"])
Returns an instance of Appeal object
        based on it's dictionary version
Returns an instance of Appeal object
based on it's dictionary version
Returns an instance of Appeal object based on it ' s dictionary version
def import_dict(transaction: dict) -> Optional[Appeal]:
        keys = ["sender", "verdict", "signature"]
        if any([not key in keys for key in transaction.keys()]):
            print("Invalid transaction: Keys missing")
            return None
        try:
            sender = ID(**transaction["sender"])
        except TypeError:
            print("Invalid transaction: Invalid sender ID")
            return None
        verdict = Verdict.import_dict(transaction["verdict"])
        if verdict is None:
            print("Invalid transaction: Verdict must be valid")
            return None
        return Appeal(sender, verdict, transaction["signature"])
def import_dict ( transaction : dict ) -> Optional [ Appeal ] : keys = [ "sender" , "verdict" , "signature" ] if any ( [ not key in keys for key in transaction . keys ( ) ] ) : print ( "Invalid transaction: Keys missing" ) return None try : sender = ID ( ** transaction [ "sender" ] ) except TypeError : print ( "Invalid transaction: Invalid sender ID" ) return None verdict = Verdict . import_dict ( transaction [ "verdict" ] ) if verdict is None : print ( "Invalid transaction: Verdict must be valid" ) return None return Appeal ( sender , verdict , transaction [ "signature" ] )
Returns an instance of Appeal object
based on it's dictionary version
Returns an instance of Appeal object based on it ' s dictionary version
"""Returns an instance of Appeal object
        based on it's dictionary version"""
transaction
dict