jamcodec 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jamcodec-0.1.0 → jamcodec-0.1.1}/PKG-INFO +1 -1
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec/types.py +9 -6
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec.egg-info/PKG-INFO +1 -1
- {jamcodec-0.1.0 → jamcodec-0.1.1}/LICENSE +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/README.md +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec/__init__.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec/base.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec/constants.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec/exceptions.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec/mixins.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec.egg-info/SOURCES.txt +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec.egg-info/dependency_links.txt +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec.egg-info/requires.txt +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/jamcodec.egg-info/top_level.txt +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/pyproject.toml +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/requirements.txt +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/setup.cfg +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_array.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_bitarray.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_bitvec.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_boolean.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_bytes.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_compact.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_enum.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_float.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_hashmap.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_integer.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_map.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_mixins.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_option.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_scale_types.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_scalebytes.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_string.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_struct.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_tuple.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_varint.py +0 -0
- {jamcodec-0.1.0 → jamcodec-0.1.1}/test/test_vec.py +0 -0
|
@@ -203,7 +203,7 @@ class Struct(JamCodecTypeDef):
|
|
|
203
203
|
if name not in value:
|
|
204
204
|
raise ScaleEncodeException(f'Argument "{name}" of Struct is missing in given value')
|
|
205
205
|
|
|
206
|
-
data += scale_obj.
|
|
206
|
+
data += scale_obj.encode(value[name])
|
|
207
207
|
|
|
208
208
|
if value[name] and issubclass(value[name].__class__, JamCodecType):
|
|
209
209
|
value[name] = value[name].serialize()
|
|
@@ -280,7 +280,7 @@ class Tuple(JamCodecTypeDef):
|
|
|
280
280
|
data = JamBytes(bytearray())
|
|
281
281
|
for idx, scale_obj in enumerate(self.values):
|
|
282
282
|
|
|
283
|
-
data += scale_obj.
|
|
283
|
+
data += scale_obj.encode(value[idx])
|
|
284
284
|
return data
|
|
285
285
|
|
|
286
286
|
def decode(self, data: JamBytes) -> tuple:
|
|
@@ -377,7 +377,7 @@ class Enum(JamCodecTypeDef):
|
|
|
377
377
|
|
|
378
378
|
if variant_obj is not None:
|
|
379
379
|
|
|
380
|
-
data += variant_obj.
|
|
380
|
+
data += variant_obj.encode(enum_value)
|
|
381
381
|
|
|
382
382
|
return data
|
|
383
383
|
|
|
@@ -603,9 +603,12 @@ class Vec(JamCodecTypeDef):
|
|
|
603
603
|
data = VarInt64.encode(len(value))
|
|
604
604
|
|
|
605
605
|
for idx, item in enumerate(value):
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
606
|
+
if type(item) is JamBytes:
|
|
607
|
+
data += item
|
|
608
|
+
else:
|
|
609
|
+
data += self.type_def.encode(item)
|
|
610
|
+
if item and issubclass(item.__class__, JamCodecType):
|
|
611
|
+
value[idx] = item.serialize()
|
|
609
612
|
|
|
610
613
|
return data
|
|
611
614
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|