this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pin cbrrr version, add CI testing

+28 -5
+23
.github/workflows/test.yml
··· 1 + name: Run tests 2 + run-name: ${{ github.actor }} is running tests 3 + on: push 4 + jobs: 5 + Tests: 6 + runs-on: ubuntu-latest 7 + strategy: 8 + matrix: 9 + python-version: [ '3.11', '3.12' ] 10 + name: Python ${{ matrix.python-version }} tests 11 + steps: 12 + - uses: actions/checkout@v4 13 + with: 14 + submodules: recursive 15 + - uses: actions/setup-python@v5 16 + with: 17 + python-version: ${{ matrix.python-version }} 18 + - name: Install atmst python module 19 + run: | 20 + python3 -m pip install -v . 21 + - name: Run the tests 22 + run: | 23 + python3 -m unittest -v
+1 -1
pyproject.toml
··· 19 19 "Operating System :: OS Independent", 20 20 ] 21 21 dependencies = [ 22 - "cbrrr@git+https://github.com/DavidBuchanan314/dag-cbrrr", 22 + "cbrrr==0.0.1", 23 23 "more-itertools", 24 24 "lru-dict", 25 25 ]
+4 -4
src/atmst/blockstore/car_file.py
··· 67 67 break # EOF 68 68 start = file.tell() 69 69 CID_LENGTH = 36 # XXX: this is a questionable assumption!!! 70 - cid = file.read(CID_LENGTH) 71 - if cid[:4] != b"\x01\x71\x12\x20": # I think this is enough to verify the assumption 70 + cid = CID(file.read(CID_LENGTH)) 71 + if not cid.is_cidv1_dag_cbor_sha256_32(): # I think this is enough to verify the assumption 72 72 raise ValueError("unsupported CID type") 73 - self.block_offsets[cid] = (start + CID_LENGTH, length - CID_LENGTH) 73 + self.block_offsets[bytes(cid)] = (start + CID_LENGTH, length - CID_LENGTH) 74 74 file.seek(start + length) 75 75 76 76 def put_block(self, key: bytes, value: bytes) -> None: ··· 83 83 if len(value) != length: 84 84 raise EOFError() 85 85 if self.validate_hashes: 86 - if key[:4] != b"\x01\x71\x12\x20": 86 + if key[:4] != CID.CIDV1_DAG_CBOR_SHA256_32_PFX: 87 87 raise ValueError("unsupported CID type") 88 88 digest = hashlib.sha256(value).digest() 89 89 if digest != key[4:]: