Skip to content

Commit

Permalink
Update tx payload in e2e tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
koxu1996 committed Apr 4, 2024
1 parent e5193f1 commit 5267022
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions nixos/tests/end-to-end.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,33 @@ nixosTest {
kairos.succeed("casper-client get-node-status --node-address http://localhost:11101")
deposit_request = { "public_key": "publickey", "amount": 10 }
# Tx Payload
# nonce = 1
# deposit:
# amount = 1000
#
deposit_payload = "3009020101a004020203e8"
deposit_request = { "public_key": "deadbeef", "payload": deposit_payload, "signature": "cafebabe" }
# REST API
client.succeed("curl --fail-with-body -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 }
# Tx Payload
# nonce = 2
# transfer:
# recipient = DEADBEEF
# amount = 1000
#
transfer_payload = "300f020102a10a0404deadbeef020203e8"
transfer_request = { "public_key": "deadbeef", "payload": transfer_payload, "signature": "cafebabe" }
client.succeed("curl --fail-with-body -X POST http://kairos/api/v1/transfer -H 'Content-Type: application/json' -d '{}'".format(json.dumps(transfer_request)))
withdraw_request = { "public_key": "publickey", "signature": "signature", "amount": 10 }
# Tx Payload
# nonce = 3
# withdrawal:
# amount = 1000
#
withdraw_payload = "3009020103a204020203e8"
withdraw_request = { "public_key": "deadbeef", "payload": withdraw_payload, "signature": "cafebabe" }
client.succeed("curl --fail-with-body -X POST http://kairos/api/v1/withdraw -H 'Content-Type: application/json' -d '{}'".format(json.dumps(withdraw_request)))
# CLI with ed25519
Expand Down

0 comments on commit 5267022

Please sign in to comment.