Skip to content

Commit

Permalink
Add test.sh and test2.sh for test that use receiver's address and id …
Browse files Browse the repository at this point in the history
…at /makeTx and /sendProof
  • Loading branch information
ujin0 committed Feb 23, 2019
1 parent 2932606 commit d0339a9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "0x7349Fbaa12158E9750B6736712694935445b7091", "value": 1}' \
localhost:3001/api/makeTx;

curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "0xc33c4D08B16f52D3AF7DfE7De94CBc45b340Fd22", "value":1}' \
localhost:3001/api/makeTx;

curl -X POST localhost:3001/api/startMiner;

curl -X POST localhost:3001/api/mineBlock;

curl -X POST localhost:3001/api/sendBlock;

curl -H "Content-Type: application/json" -X POST \
--data '{"blockNonce":2, "receiverId": "userB"}' \
localhost:3001/api/sendProof;

curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "0x7349Fbaa12158E9750B6736712694935445b7091", "value": 1}' \
localhost:3002/api/makeTx;

curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "0xc33c4D08B16f52D3AF7DfE7De94CBc45b340Fd22", "value":1}' \
localhost:3002/api/makeTx;

curl -X POST localhost:3002/api/startMiner;
curl -X POST localhost:3002/api/mineBlock;
curl -X POST localhost:3002/api/sendBlock;

25 changes: 25 additions & 0 deletions tests/test2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "userB", "value": 1}' \
localhost:3001/api/makeTx 2<&1;
curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "userA", "value":1}' \
localhost:3001/api/makeTx 2<&1;
curl -X POST localhost:3001/api/startMiner 2<&1;
curl -X POST localhost:3001/api/mineBlock 2<&1;
curl -X POST localhost:3001/api/sendBlock 2<&1;
curl -H "Content-Type: application/json" -X POST \
--data '{"blockNonce":2, "receiver": "0x7349Fbaa12158E9750B6736712694935445b7091"}' \
localhost:3001/api/sendProof 2<&1;
curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "userB", "value": 1}' \
localhost:3002/api/makeTx 2<&1;
curl -H "Content-Type: application/json" -X POST \
--data '{"receiver": "userA", "value":1}' \
localhost:3002/api/makeTx 2<&1;
curl -X POST localhost:3002/api/startMiner 2<&1;
curl -X POST localhost:3002/api/mineBlock 2<&1;
curl -X POST localhost:3002/api/sendBlock 2<&1;


0 comments on commit d0339a9

Please sign in to comment.