Skip to content

Commit

Permalink
Smart contract changes (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
volod-vana authored Oct 18, 2024
1 parent 1f65c09 commit 12e165b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vana"
version = "0.20.0"
version = "0.21.0"
description = ""
authors = ["Tim Nunamaker <[email protected]>", "Volodymyr Isai <[email protected]>", "Kahtaf Alam <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion vana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 13 additions & 1 deletion vana/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 12e165b

Please sign in to comment.