diff --git a/psf-memo-client/specs/mute-user.feature b/psf-memo-client/specs/mute-user.feature new file mode 100644 index 0000000..b3a5c3f --- /dev/null +++ b/psf-memo-client/specs/mute-user.feature @@ -0,0 +1,55 @@ +# Scenarios: Mute User - 1, Mute User - 2, Mute User - 3, Mute User - 4, Mute User - 5 +# +# The mute/unmute OP_RETURN payload is the target's 20-byte hash160. +# Convert the target's cash address with bch-js Address.toHash160() (available +# through the minimal-slp-wallet embedded bch-js) before broadcasting 0x6d16 / +# 0x6d17. Do not add a separate cashaddr dependency. +Feature: Mute User + + Background: + Given a wallet authenticated for the address bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d + Given the wallet has spendable output to pay the transaction fee + + Scenario Outline: Mute User - 1 viewing another user's profile shows a Mute button + Given I open the profile page for the address + Then the profile page shows a Mute button + + Examples: + | addr | + | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | + | bitcoincash:qqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r | + + Scenario Outline: Mute User - 2 clicking Mute broadcasts the mute action and shows Unmute + Given I open the profile page for the address + When I click the Mute button + Then the app broadcasts an OP_RETURN transaction with the Memo mute prefix for the address + Then the profile page shows an Unmute button + + Examples: + | addr | + | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | + + Scenario Outline: Mute User - 3 clicking Unmute broadcasts the unmute action and shows Mute + Given the psf-memo-db API reports that I mute the address + Given I open the profile page for the address + When I click the Unmute button + Then the app broadcasts an OP_RETURN transaction with the Memo unmute prefix for the address + Then the profile page shows a Mute button + + Examples: + | addr | + | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | + + Scenario: Mute User - 4 viewing my own profile does not show a Mute button + Given I open the profile page for my own address + Then the profile page does not show a Mute button + + Scenario Outline: Mute User - 5 the profile page shows Unmute when I already mute the user + Given the psf-memo-db API reports that I mute the address + Given I open the profile page for the address + Then the profile page shows an Unmute button + + Examples: + | addr | + | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | + | bitcoincash:qqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r | diff --git a/psf-memo-db/specs/mute-read.feature b/psf-memo-db/specs/mute-read.feature new file mode 100644 index 0000000..ddb9627 --- /dev/null +++ b/psf-memo-db/specs/mute-read.feature @@ -0,0 +1,30 @@ +# Scenarios: Mute Read - 1, Mute Read - 2 +# +# The mutes store keys mutees by 20-byte hash160. Use bch-js +# Address.toHash160() / Address.hash160ToCash() to convert between cash +# addresses and hash160 for the mute state and muted-user lists. +# Prefer bch-js over adding a separate cashaddr dependency. +Feature: Mute Read + + Background: + Given a psf-memo-db instance with a mutes store + Given the fixture "mutes" is loaded into the mutes store + + Scenario Outline: Mute Read - 1 GET /mute/state reports whether a muter mutes a mutee + When the client requests the mute state for muter and mutee + Then the mute state reports muted + + Examples: + | muter | mutee | muted | + | bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | true | + | bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d | bitcoincash:qqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r | false | + | bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | true | + + Scenario Outline: Mute Read - 2 GET /mute/muted lists the addresses a muter mutes + When the client requests the muted list for + Then the muted list contains the addresses + + Examples: + | muter | expected | + | bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | + | bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | diff --git a/psf-memo-indexer/specs/mute-indexer.feature b/psf-memo-indexer/specs/mute-indexer.feature new file mode 100644 index 0000000..c5bdb46 --- /dev/null +++ b/psf-memo-indexer/specs/mute-indexer.feature @@ -0,0 +1,36 @@ +# Scenarios: Mute Indexer - 1, Mute Indexer - 2, Mute Indexer - 3 +# +# The indexer parses Memo mute actions and stores structured records: +# - 0x6d16 mute: target address (20-byte hash160) +# - 0x6d17 unmute: target address (20-byte hash160) +# The target is a 20-byte P2PKH hash160, like the follow/unfollow payload. +Feature: Mute Indexer + + Background: + Given a psf-memo-db instance that records mute records + Given a psf-memo-indexer configured to write to that database + + Scenario Outline: Mute Indexer - 1 a mute transaction stores the mute record + When the indexer processes a mute transaction for the address from + Then the psf-memo-db stores a mute record for the address by + + Examples: + | addr | muter | + | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d | + | bitcoincash:qqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r | bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d | + + Scenario Outline: Mute Indexer - 2 an unmute transaction stores the unmute record + When the indexer processes an unmute transaction for the address from + Then the psf-memo-db stores an unmute record for the address by + + Examples: + | addr | muter | + | bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d | + + Scenario Outline: Mute Indexer - 3 a mute transaction with a wrong-size address is rejected + When the indexer processes a mute transaction for the address from + Then the indexer records a process error and stores no mute record + + Examples: + | addr | muter | + | | bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d |