예제 #1
0
파일: big_map.py 프로젝트: multisme/pytezos
 def from_micheline_value(cls, val_expr) -> 'BigMapType':
     if isinstance(val_expr, dict):
         ptr = parse_micheline_literal(val_expr, {'int': int})
         return cls(items=[], ptr=ptr)
     else:
         items = super(BigMapType, cls).parse_micheline_value(val_expr)
         return cls(items=items)
예제 #2
0
파일: domain.py 프로젝트: multisme/pytezos
 def from_micheline_value(cls, val_expr) -> 'ChainIdType':
     value = parse_micheline_literal(
         val_expr, {
             'bytes': lambda x: unforge_chain_id(bytes.fromhex(x)),
             'string': lambda x: x
         })
     return cls.from_value(value)
예제 #3
0
파일: domain.py 프로젝트: multisme/pytezos
 def from_micheline_value(cls, val_expr) -> 'SignatureType':
     value = parse_micheline_literal(
         val_expr, {
             'bytes': lambda x: unforge_signature(bytes.fromhex(x)),
             'string': lambda x: x
         })
     return cls.from_value(value)
예제 #4
0
파일: domain.py 프로젝트: multisme/pytezos
 def from_micheline_value(cls, val_expr) -> 'KeyHashType':
     value = parse_micheline_literal(
         val_expr, {
             'bytes': lambda x: unforge_address(bytes.fromhex(x)),
             'string': lambda x: x
         })
     return cls.from_value(value)
예제 #5
0
 def from_micheline_value(cls, val_expr) -> 'IntType':
     value = parse_micheline_literal(
         val_expr, {
             'int': int,
             'bytes': lambda x: cls.bytes_to_int(bytes.fromhex(x))
         })
     return cls.from_value(value)
예제 #6
0
파일: sapling.py 프로젝트: kengkiat/pytezos
 def from_micheline_value(cls, val_expr) -> 'SaplingStateType':
     if isinstance(val_expr, dict):
         ptr = parse_micheline_literal(val_expr, {'int': int})
         return cls(ptr=ptr)
     elif isinstance(val_expr, list):
         return cls()
     else:
         assert False, f'unexpected value {val_expr}'
예제 #7
0
 def from_micheline_value(cls, val_expr) -> 'StringType':
     value = parse_micheline_literal(val_expr, {'string': str})
     return cls.from_value(value)
예제 #8
0
 def from_micheline_value(cls, val_expr) -> 'BytesType':
     value = parse_micheline_literal(val_expr, {'bytes': bytes.fromhex})
     return cls(value)
예제 #9
0
 def from_micheline_value(cls, val_expr) -> 'NatType':
     value = parse_micheline_literal(val_expr, {'int': int})
     return cls.from_value(value)
예제 #10
0
파일: domain.py 프로젝트: multisme/pytezos
 def from_micheline_value(cls, val_expr) -> 'TimestampType':
     value = parse_micheline_literal(val_expr, {
         'int': int,
         'string': optimize_timestamp
     })
     return cls.from_value(value)