Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 15 additions & 45 deletions sdk-abi/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ crate-type = ["cdylib"]

[dependencies]
anyhow = "1"
pyo3 = { version = "0.20.0", features = ["extension-module", "abi3-py37", "anyhow"] }
pyo3 = { version = "0.29", features = ["extension-module", "abi3-py38", "anyhow"] }
serde_json = "1"
leo-abi = { git = "https://github.com/ProvableHQ/leo", rev = "ba2c01722a48f84b4d90b93aeaf8305b7c03dbce", package = "leo-abi", features = ["aleo-bytecode"] }
leo-ast = { git = "https://github.com/ProvableHQ/leo", rev = "ba2c01722a48f84b4d90b93aeaf8305b7c03dbce", package = "leo-ast" }
Expand Down
2 changes: 1 addition & 1 deletion sdk-abi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "0.2.0"
description = "Python bindings for ABI generation from Aleo bytecode"
readme = "README.md"
license = {text = "GPL-3.0-or-later"}
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = []

[tool.maturin]
Expand Down
2 changes: 1 addition & 1 deletion sdk-abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn check_compatibility(
}

#[pymodule]
fn _aleo_abi(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
fn _aleo_abi(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(generate_abi, m)?)?;
m.add_function(wrap_pyfunction!(check_compatibility, m)?)?;
Ok(())
Expand Down
54 changes: 22 additions & 32 deletions sdk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ anyhow = "1"
hex = "0.4"
indexmap = "2.1.0"
once_cell = "1.18.0"
pyo3 = { version = "0.20.0", features = ["extension-module", "abi3-py37", "anyhow"] }
pyo3 = { version = "0.29", features = ["extension-module", "abi3-py38", "anyhow"] }
rand = { version = "0.10" }
serde = "1"
serde_json = "1"
Expand Down
1 change: 1 addition & 0 deletions sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "aleo-sdk"
description = "Python SDK for building zero-knowledge apps and DeFi on the Aleo network"
version = "0.2.0"
requires-python = ">=3.8"
readme = "Readme.md"
license = {file = "LICENSE.md"}
authors = [
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/tests/test_account_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ def test_bytes_type(self):
pk = PrivateKey.random()
vk = pk.view_key
b = vk.bytes()
assert isinstance(b, list)
assert all(isinstance(x, int) for x in b)
assert isinstance(b, bytes) # pyo3 0.23+: Vec<u8> maps to bytes
assert len(b) == 32


# ---------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,6 @@ def _make_auth(self):
def test_authorization_bytes_round_trip(self):
auth = self._make_auth()
raw = auth.bytes()
assert isinstance(raw, list)
auth2 = Authorization.from_bytes(bytes(raw))
assert isinstance(raw, bytes) # pyo3 0.23+: Vec<u8> maps to bytes
auth2 = Authorization.from_bytes(raw)
assert auth.to_json() == auth2.to_json()
8 changes: 4 additions & 4 deletions sdk/python/tests/test_value_plaintext.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ def test_to_bits_raw_be(self):
def test_to_bytes_raw_le(self):
p = Plaintext.from_string(PLAINTEXT_LITERAL)
raw = p.to_bytes_raw_le()
assert isinstance(raw, list)
assert all(isinstance(x, int) for x in raw)
assert isinstance(raw, bytes) # pyo3 0.23+: Vec<u8> maps to bytes
assert len(raw) > 0

def test_to_bytes_raw_be(self):
p = Plaintext.from_string(PLAINTEXT_LITERAL)
raw = p.to_bytes_raw_be()
assert isinstance(raw, list)
assert all(isinstance(x, int) for x in raw)
assert isinstance(raw, bytes) # pyo3 0.23+: Vec<u8> maps to bytes
assert len(raw) > 0

def test_to_fields_roundtrip(self):
p = Plaintext.from_string(STRUCT)
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/account/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use std::{
};

/// The Aleo address type.
#[pyclass(frozen)]
#[pyclass(frozen, from_py_object)]
#[derive(Clone)]
pub struct Address(AddressNative);

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/account/graph_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::{
};

/// The account graph key used for record scanning.
#[pyclass(frozen)]
#[pyclass(frozen, from_py_object)]
#[derive(Clone)]
pub struct GraphKey(GraphKeyNative);

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/account/private_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use std::{
};

/// The Aleo private key type.
#[pyclass(frozen)]
#[pyclass(frozen, from_py_object)]
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct PrivateKey(PrivateKeyNative);

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/account/private_key_ciphertext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use std::{
};

/// Private key encrypted into ciphertext using a secret.
#[pyclass(frozen)]
#[pyclass(frozen, from_py_object)]
#[derive(Clone)]
pub struct PrivateKeyCiphertext(CiphertextNative);

Expand Down
Loading
Loading