Skip to content

Commit

Permalink
add multiple voters to index votes test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanchristo committed Aug 31, 2023
1 parent bbb7aca commit 7b63297
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docker/tester.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ RUN regen config chain-id $REGEN_CHAIN_ID
RUN regen config keyring-backend test

# Add accounts
RUN printf "trouble alarm laptop turn call stem lend brown play planet grocery survey smooth seed describe hood praise whale smile repeat dry sauce front future\n\n" | regen keys --keyring-backend test add validator -i
RUN printf "cool trust waste core unusual report duck amazing fault juice wish century across ghost cigar diary correct draw glimpse face crush rapid quit equip\n\n" | regen keys --keyring-backend test add user -i
RUN printf "cool trust waste core unusual report duck amazing fault juice wish century across ghost cigar diary correct draw glimpse face crush rapid quit equip\n\n" | regen keys --keyring-backend test add user1 -i
RUN printf "music debris chicken erode flag law demise over fall always put bounce ring school dumb ivory spin saddle ostrich better seminar heart beach kingdom\n\n" | regen keys --keyring-backend test add user2 -i

# Copy tester start script
COPY docker/scripts/tester_start.sh /home/tester/scripts/
Expand Down
13 changes: 3 additions & 10 deletions docker/tester/test_index_votes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,15 @@ proposal_id=$(regen q group proposals-by-group-policy "$policy_address" --output
# vote "yes" on proposal with user 1
regen tx group vote "$proposal_id" "$address1" VOTE_OPTION_YES "" --from "$address1" $regen_tx_flags

# wait for transaction to be processed
sleep 10

# TODO: confirm vote NOT indexed in database
psql postgres://postgres:password@localhost:5432/postgres -c "SELECT * from votes;"
# TODO: if vote found, then exit 1

# vote "yes" on proposal with user 2
regen tx group vote "$proposal_id" "$address1" VOTE_OPTION_YES "" --from "$address2" $regen_tx_flags

# wait for transaction to be processed and voting period to end
# wait for transactions to be processed
sleep 10

# TODO: confirm vote NOT indexed in database
# TODO: confirm votes NOT indexed in database
psql postgres://postgres:password@localhost:5432/postgres -c "SELECT * from votes;"
# TODO: if vote found, then exit 1
# TODO: if votes found, then exit 1

# execute proposal
regen tx group exec "$proposal_id" --from "$address1" $regen_tx_flags
Expand Down

0 comments on commit 7b63297

Please sign in to comment.