From cb3abd01bd631a699fcca5ae4864642b09feb417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marijan=20Petri=C4=8Devi=C4=87?= Date: Tue, 19 Mar 2024 11:22:16 -0500 Subject: [PATCH] nixos/tests: test both ed25519 and secp256k1 in e2e --- nixos/tests/end-to-end.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nixos/tests/end-to-end.nix b/nixos/tests/end-to-end.nix index 98d6396a..335fa8b4 100644 --- a/nixos/tests/end-to-end.nix +++ b/nixos/tests/end-to-end.nix @@ -36,6 +36,7 @@ nixosTest { client.wait_for_unit ("multi-user.target") deposit_request = { "public_key": "publickey", "amount": 10 } + # REST API client.succeed("curl -X POST http://kairos/api/v1/deposit -H 'Content-Type: application/json' -d '{}'".format(json.dumps(deposit_request))) transfer_request = { "from": "publickey", "signature": "signature", "to": "publickey", "amount": 10 } @@ -44,14 +45,25 @@ nixosTest { withdraw_request = { "public_key": "publickey", "signature": "signature", "amount": 10 } client.succeed("curl -X POST http://kairos/api/v1/withdraw -H 'Content-Type: application/json' -d '{}'".format(json.dumps(withdraw_request))) + # CLI with ed25519 cli_output = client.succeed("kairos-cli deposit --amount 1000 --private-key ${testResources}/ed25519/secret_key.pem") assert "ok\n" in cli_output - cli_output = client.succeed("kairos-cli transfer --recipient '01a26419a7d82b2263deaedea32d35eee8ae1c850bd477f62a82939f06e80df356' --amount 1000 --private-key ${testResources}/secp256k1/secret_key.pem") + cli_output = client.succeed("kairos-cli transfer --recipient '01a26419a7d82b2263deaedea32d35eee8ae1c850bd477f62a82939f06e80df356' --amount 1000 --private-key ${testResources}/ed25519/secret_key.pem") assert "ok\n" in cli_output cli_output = client.succeed("kairos-cli withdraw --amount 1000 --private-key ${testResources}/ed25519/secret_key.pem") assert "ok\n" in cli_output + + # CLI with secp256k1 + cli_output = client.succeed("kairos-cli deposit --amount 1000 --private-key ${testResources}/secp256k1/secret_key.pem") + assert "ok\n" in cli_output + + cli_output = client.succeed("kairos-cli transfer --recipient '01a26419a7d82b2263deaedea32d35eee8ae1c850bd477f62a82939f06e80df356' --amount 1000 --private-key ${testResources}/secp256k1/secret_key.pem") + assert "ok\n" in cli_output + + cli_output = client.succeed("kairos-cli withdraw --amount 1000 --private-key ${testResources}/secp256k1/secret_key.pem") + assert "ok\n" in cli_output ''; }