cli fixes

This commit is contained in:
John Smith
2023-06-20 23:46:39 -04:00
parent e80a3d3063
commit 1c8ecab2b6
11 changed files with 170 additions and 69 deletions

View File

@@ -67,6 +67,9 @@ async def test_set_get_dht_value(api_connection: veilid.VeilidAPI):
vd2 = await rc.get_dht_value(rec.key, 0, False)
assert vd2 != None
print("vd: {}", vd.__dict__)
print("vd2: {}", vd2.__dict__)
assert vd == vd2
await rc.close_dht_record(rec.key)

View File

@@ -2,6 +2,7 @@ import base64
import json
from enum import StrEnum
from typing import Any, Optional, Self, Tuple
from functools import total_ordering
####################################################################
@@ -323,6 +324,7 @@ class DHTRecordDescriptor:
return self.__dict__
# @total_ordering
class ValueData:
seq: ValueSeqNum
data: bytes
@@ -333,6 +335,21 @@ class ValueData:
self.data = data
self.writer = writer
# def __lt__(self, other):
# return self.data < other.data
# def __eq__(self, other):
# return self.cgpa == other.cgpa
# def __le__(self, other):
# return self.cgpa<= other.cgpa
# def __ge__(self, other):
# return self.cgpa>= other.cgpa
# def __ne__(self, other):
# return self.cgpa != other.cgpa
@classmethod
def from_json(cls, j: dict) -> Self:
return cls(