From 5d7ce7601b925a4826de672329d2ea364e2c6f85 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Fri, 28 Aug 2026 14:11:14 -0700 Subject: [PATCH] Spec P3 poll actions: create poll, add option, vote By specifier. --- psf-memo-client/specs/poll-create.feature | 54 +++++++++++++++++ psf-memo-client/specs/poll-option.feature | 58 +++++++++++++++++++ psf-memo-client/specs/poll-vote.feature | 45 +++++++++++++++ psf-memo-db/specs/poll-read.feature | 39 +++++++++++++ psf-memo-indexer/specs/poll-indexer.feature | 64 +++++++++++++++++++++ 5 files changed, 260 insertions(+) create mode 100644 psf-memo-client/specs/poll-create.feature create mode 100644 psf-memo-client/specs/poll-option.feature create mode 100644 psf-memo-client/specs/poll-vote.feature create mode 100644 psf-memo-db/specs/poll-read.feature create mode 100644 psf-memo-indexer/specs/poll-indexer.feature diff --git a/psf-memo-client/specs/poll-create.feature b/psf-memo-client/specs/poll-create.feature new file mode 100644 index 0000000..0041f5f --- /dev/null +++ b/psf-memo-client/specs/poll-create.feature @@ -0,0 +1,54 @@ +# Scenarios: Poll Create - 1, Poll Create - 2, Poll Create - 3, Poll Create - 4 +# +# The poll composer broadcasts a Memo create-poll action (0x6d10). The +# payload is a poll_type byte, an option_count byte, and the question text. +# The question is limited to 209 bytes. The composer counts bytes (not +# characters) so the remaining count reflects the question text. Options are +# added by separate add-poll-option actions (0x6d13). +Feature: Poll Create + + Background: + Given a wallet authenticated for the address bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d + Given the wallet has spendable output to pay the transaction fee + + Scenario Outline: Poll Create - 1 a valid poll is broadcast with the question and option count + When I compose a poll with the question "" and options + When I submit the poll + Then the app broadcasts an OP_RETURN transaction with the Memo create-poll prefix for the question "" + Then the app broadcasts an OP_RETURN transaction with the Memo create-poll prefix carrying options + + Examples: + | question | option_count | + | which is better? | 2 | + | what should we build next? | 3 | + | a valid question with several words and punctuation. | 2 | + + Scenario Outline: Poll Create - 2 an empty question is rejected + When I compose a poll with the question "" and 2 options + When I submit the poll + Then the poll composer shows a validation error + Then the app does not broadcast any transaction + + Examples: + | question | + | | + + Scenario Outline: Poll Create - 3 an over-long question is rejected + When I compose a poll with the question "" and 2 options + When I submit the poll + Then the poll composer shows a length error + Then the app does not broadcast any transaction + + Examples: + | question | + | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | + + Scenario Outline: Poll Create - 4 the byte counter counts down from the question limit + When I compose a poll with the question "" and 2 options + Then the poll composer shows a remaining byte count of + + Examples: + | question | count | + | | 209 | + | hello | 204 | + | é | 207 | diff --git a/psf-memo-client/specs/poll-option.feature b/psf-memo-client/specs/poll-option.feature new file mode 100644 index 0000000..912c5e1 --- /dev/null +++ b/psf-memo-client/specs/poll-option.feature @@ -0,0 +1,58 @@ +# Scenarios: Poll Option - 1, Poll Option - 2, Poll Option - 3, Poll Option - 4 +# +# The add-option composer broadcasts a Memo add-poll-option action (0x6d13). +# The payload is the poll's 32-byte txid followed by the option text. The +# option text is limited to 184 bytes. The composer counts bytes (not +# characters) so the remaining count reflects the option text. +Feature: Poll Option + + Background: + Given a wallet authenticated for the address bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d + Given the wallet has spendable output to pay the transaction fee + Given a poll with the txid aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + + Scenario Outline: Poll Option - 1 a valid option is broadcast for the poll + When I open the poll with txid + When I compose an option with the text "