canoser
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: canoser | ||
| Version: 0.7.11 | ||
| Version: 0.8.1 | ||
| Summary: A python implementation of the LCS(Libra Canonical Serialization) for the Libra network. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/yuan-xy/canoser-python.git |
@@ -18,2 +18,4 @@ from canoser.base import Base | ||
| def encode(self, arr): | ||
| if self.fixed_len is not None and len(arr) != self.fixed_len: | ||
| raise TypeError(f"{len(arr)} is not equal to predefined value: {self.fixed_len}") | ||
| output = b"" | ||
@@ -20,0 +22,0 @@ if self.encode_len: |
@@ -66,3 +66,3 @@ import struct | ||
| if isinstance(value, bool): | ||
| raise TypeError(f"{s} is not a integer") | ||
| raise TypeError(f"{value} is not a integer") | ||
| if not isinstance(value, int): | ||
@@ -69,0 +69,0 @@ raise TypeError(f"{value} is not instance of <int>.") |
+1
-0
@@ -32,2 +32,3 @@ from canoser.base import Base | ||
| kvs[k] = v | ||
| #TODO: check the key order of kvs, because lcs has order when serialize map. | ||
| return kvs | ||
@@ -34,0 +35,0 @@ |
@@ -1,1 +0,1 @@ | ||
| version = "0.7.11" | ||
| version = "0.8.1" |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: canoser | ||
| Version: 0.7.11 | ||
| Version: 0.8.1 | ||
| Summary: A python implementation of the LCS(Libra Canonical Serialization) for the Libra network. | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/yuan-xy/canoser-python.git |
@@ -136,2 +136,4 @@ import pytest | ||
| assert x3.value == [['ab', 'c'], ['d'], []] | ||
| jstr = x3.to_json() | ||
| print(jstr) | ||
| assert x2.__repr__() == """MyEnumWrap{ | ||
@@ -138,0 +140,0 @@ "opt3": [ |
@@ -16,3 +16,3 @@ from canoser import * | ||
| def test_str_to_int(): | ||
| with pytest.raises(Exception): | ||
| with pytest.raises(ValueError): | ||
| Uint8.int_unsafe("") | ||
@@ -25,7 +25,7 @@ assert 0 == Uint8.int_unsafe("0") | ||
| assert 255 == Uint8.int_unsafe("0255") | ||
| with pytest.raises(Exception): | ||
| with pytest.raises(TypeError): | ||
| Uint8.int_unsafe("-1") | ||
| with pytest.raises(Exception): | ||
| with pytest.raises(TypeError): | ||
| Uint8.int_unsafe("256") | ||
| with pytest.raises(Exception): | ||
| with pytest.raises(TypeError): | ||
| Uint8.check_value(True) | ||
@@ -32,0 +32,0 @@ |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
109514
0.27%1641
0.31%