Ejemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        if check_for_class(self, args):
            return
        if len(args) == 1 and len(kwargs) == 0:
            kwargs = args[0]

        prefix = kwargs.get("prefix", default_prefix)
        extensions = Array([])
        if "end_date" in kwargs and kwargs["end_date"]:
            extension = {
                'type': 'update_proposal_end_date',
                'value': {
                    'end_date': kwargs["end_date"]
                }
            }
            extensions = Array([UpdateProposalExtensions(extension)])

        super(Update_proposal, self).__init__(
            OrderedDict([('proposal_id', Uint64(kwargs["proposal_id"])),
                         ('creator', String(kwargs["creator"])),
                         ('daily_pay',
                          Amount(kwargs["daily_pay"], prefix=prefix)),
                         ('subject', String(kwargs["subject"])),
                         ('permlink', String(kwargs["permlink"])),
                         ('extensions', extensions)]))
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        if check_for_class(self, args):
            return
        if len(args) == 1 and len(kwargs) == 0:
            kwargs = args[0]
        prefix = kwargs.get("prefix", default_prefix)
        extensions = Array([])
        proposal_ids = []
        for e in kwargs["proposal_ids"]:
            proposal_ids.append(Uint64(e))

        super(Remove_proposal, self).__init__(
            OrderedDict([('proposal_owner', String(kwargs["voter"])),
                         ('proposal_ids', Array(proposal_ids)),
                         ('extensions', extensions)]))
Ejemplo n.º 3
0
    def __init__(self, *args, **kwargs):
        if check_for_class(self, args):
            return
        if len(args) == 1 and len(kwargs) == 0:
            kwargs = args[0]
        extensions = Array([])
        proposal_ids = []
        for e in kwargs["proposal_ids"]:
            proposal_ids.append(Uint64(e))

        super(Update_proposal_votes, self).__init__(
            OrderedDict([('voter', String(kwargs["voter"])),
                         ('proposal_ids', Array(proposal_ids)),
                         ('approve', Bool(kwargs["approve"])),
                         ('extensions', extensions)]))
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     if isArgsThisClass(self, args):
             self.data = args[0].data
     else:
         prefix = kwargs.pop("prefix", default_prefix)
         if "encrypted" not in kwargs or not kwargs["encrypted"]:
             super(Memo, self).__init__(None)
         else:
             if len(args) == 1 and len(kwargs) == 0:
                 kwargs = args[0]
             if "encrypted" in kwargs and kwargs["encrypted"]:
                 super(Memo, self).__init__(OrderedDict([
                     ('from', PublicKey(kwargs["from"], prefix=prefix)),
                     ('to', PublicKey(kwargs["to"], prefix=prefix)),
                     ('nonce', Uint64(int(kwargs["nonce"]))),
                     ('check', Uint32(int(kwargs["check"]))),
                     ('encrypted', Bytes(kwargs["encrypted"]))
                 ]))