From 12e165b93e83873483c100aa40a250832fa266f6 Mon Sep 17 00:00:00 2001 From: Volod <141863857+volod-vana@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:36:30 -0400 Subject: [PATCH] Smart contract changes (#37) --- pyproject.toml | 2 +- vana/__init__.py | 2 +- vana/client.py | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0f77f75..2f48a1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vana" -version = "0.20.0" +version = "0.21.0" description = "" authors = ["Tim Nunamaker ", "Volodymyr Isai ", "Kahtaf Alam "] readme = "README.md" diff --git a/vana/__init__.py b/vana/__init__.py index 73e5d11..d977765 100644 --- a/vana/__init__.py +++ b/vana/__init__.py @@ -15,7 +15,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -__version__ = "0.20.0" +__version__ = "0.21.0" import rich diff --git a/vana/client.py b/vana/client.py index 53a6c63..1e1cf37 100644 --- a/vana/client.py +++ b/vana/client.py @@ -61,6 +61,18 @@ def get_file(self, file_id: int): return None return file + def get_file_permissions(self, file_id: int, account: str) -> str: + """ + Get the permissions for a specific account on a file. + + :param file_id: ID of the file + :param account: Address of the account to check permissions for + :return: The encryption key for the account, or an empty string if no permissions + """ + get_permissions_fn = self.data_registry_contract.functions.filePermissions(file_id, account) + permissions = self.chain_manager.read_contract_fn(get_permissions_fn) + return permissions + def add_file(self, url: str, integrity_hash: Optional[str] = None): """ Add a file to the Data Registry contract. @@ -83,7 +95,7 @@ def get_tee(self, address: str): tee = self.chain_manager.read_contract_fn(get_tee_fn) if tee is None: return None - (teeAddress, url, status, amount, withdrawnAmount) = tee + (teeAddress, url, status, amount, withdrawnAmount, jobsCount, publicKey) = tee if url == "": return None return tee