diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index acd44b4..413b4fa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,7 +11,7 @@ on: - main - master tags: - - '*' + - "*" pull_request: workflow_dispatch: @@ -35,6 +35,10 @@ jobs: manylinux: manylinux2014 target: armv7 interpreter: 3.8 3.9 3.10 3.11 3.12 + - os: linux + manylinux: manylinux_2_28 + target: aarch64 + interpreter: 3.8 3.9 3.10 3.11 3.12 - os: linux manylinux: manylinux2014 target: ppc64le @@ -46,7 +50,7 @@ jobs: - os: linux manylinux: manylinux2014 target: x86_64 - interpreter: pypy3.9 pypy3.10 + interpreter: 3.8 3.9 3.10 3.11 3.12 pypy3.9 pypy3.10 # musllinux - os: linux @@ -59,7 +63,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: "3.8" - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -74,7 +78,6 @@ jobs: name: wheels path: dist - windows: runs-on: windows-latest environment: publishing @@ -85,14 +88,14 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: "3.8" architecture: ${{ matrix.target }} - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} args: --release --out dist --find-interpreter - sccache: 'true' + sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -109,13 +112,13 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: "3.8" - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} args: --release --out dist --find-interpreter - sccache: 'true' + sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v3 with: diff --git a/Cargo.lock b/Cargo.lock index 1acca0b..0d76b44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,7 +52,7 @@ dependencies = [ [[package]] name = "cuatrorpc_rs" -version = "0.7.1" +version = "0.7.2" dependencies = [ "pyo3", "pyo3-build-config", diff --git a/Cargo.toml b/Cargo.toml index 6eac4ff..b53daf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cuatrorpc_rs" -version = "0.7.1" +version = "0.7.2" edition = "2021" authors = ["bleach86 "] description = "Fast RPC client library for Python in rust." @@ -27,6 +27,7 @@ ureq = { version = "2.8.0", features = ["json"] } pyo3 = { version = "0.20.2", features = ["extension-module"] } pythonize = "0.20.0" + serde = { version = "1.0.166", features = ["derive"] } serde_json = "1.0.100" diff --git a/python/cuatrorpc/cuatrorpc_rs.pyi b/python/cuatrorpc/cuatrorpc_rs.pyi index 38c1255..1ca226a 100644 --- a/python/cuatrorpc/cuatrorpc_rs.pyi +++ b/python/cuatrorpc/cuatrorpc_rs.pyi @@ -27,6 +27,6 @@ class RpcClientCLI: def callrpc( self, method: str, - call_args: Optional[List[Any]] = None, + params: Optional[List[Any]] = None, wallet: Optional[str] = "", ) -> Any: ... diff --git a/src/lib.rs b/src/lib.rs index 7dcbbfc..6afc79c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,6 +61,7 @@ impl RpcClient { ) -> PyResult> { let agent: Agent = AgentBuilder::new() .timeout_read(Duration::from_secs(self.rpc_timeout)) + .timeout(Duration::from_secs(self.rpc_timeout)) .build(); let params_value: Vec = @@ -126,7 +127,7 @@ impl RpcClientCLI { } fn callrpc( - &mut self, + &self, py: Python<'_>, method: &str, params: Option<&PyList>, @@ -191,8 +192,10 @@ impl RpcClientCLI { } else { let error_message: std::borrow::Cow<'_, str> = String::from_utf8_lossy(&result.stderr); - let err_res: String = error_message.replace("\n", ""); - Err(PyErr::new::(format!("{}", err_res))) + Err(PyErr::new::(format!( + "{}", + error_message + ))) } } Err(e) => Err(PyErr::new::(format!(