Skip to content

Commit

Permalink
Added some v1.2 BDD scenarios in Gherkin
Browse files Browse the repository at this point in the history
  • Loading branch information
James Browning committed Feb 15, 2021
1 parent 87c72ad commit 8a4517b
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
38 changes: 38 additions & 0 deletions bdd/features/delegation
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Feature: Delegation

Rule: Delegation transaction can be constructed

Scenario: Valid case
Given exchange holds some funds in my address
And my chosen stake pool is registered
When I provide details of my delegation intent
Then exchange can construct a transaction for this delegation
And the delegation transaction matches my delegation intent

Scenario: Invalid case – no funds
Given exchange holds no funds in my address
When I provide details of my delegation intent
Then an error is returned (this validation may not occur until submit)
And exchange cannot construct a transaction for this delegation

Scenario: Invalid case – not enough funds to delegate (less than 2ADA)
Given ...

Scenario: Invalid case – not my address (provide other pool id)
Given ...


Rule: Delegation transaction can be submitted

Scenario: Valid delegation transaction
Given exchange holds funds in my address
And exchange has constructed a valid delegation transaction
When exchange submits the transaction
Then a successful response is returned

Scenario: Invalid case – stakepool not registered
Given exchange holds funds in my address
And exchange has constructed a delegation transaction using a stakepool id that is not registered
When exchange submits the transaction
Then an error is returned
And delegation is not accepted on the blockchain
31 changes: 31 additions & 0 deletions bdd/features/pledge-to-stakepool
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Feature: Pledge to a stakepool

Rule: Pledging transaction can be constructed

Scenario: Valid case
Given there is a stakepool for which I am the owner
When I provide details of my pledging intent (consider using 'data table' with valid values)
Then exchange can construct a transaction for my pledge
And the delegation transaction matches my pledging intent

Scenario: Invalid case - no enough funds to pledge
Given ...

Scenario: Invalid case - stakepool not registered
Given ...


Rule: Pledging transaction can be submitted

Scenario: Valid pledging transaction
Given there is a stakepool for which I am the owner
And exchange has constructed a valid pledging transaction
When exchange submits the transaction
Then a successful response is returned
And pledge can be proven(?)

Scenario: Invalid case – stakepool not registered
Given exchange has constructed a delegation transaction using a stakepool id that is not registered
When exchange submits the transaction
Then an error is returned
And pledge is not accepted on the blockchain
44 changes: 44 additions & 0 deletions bdd/features/register-stakepool-owner
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Feature: Register as stakepool owner

Rule: Constructing a stakepool registration certificate (this may be client-side only and not Rosetta)

Scenario: Valid case - constructing a stakepool registration certificate
Given exchange holds funds in my address
When exchange is provided with registration details
Then exchange can successful construct a stakepool registration certiifcate


Rule: Publishing a stakepool registration certificate

Scenario: Valid case - publish stakepool registration certificate for pool that I operate
Given exchange holds funds in my address
And exchange has successfully constructed a stakepool registration certificate for pool that I operate
And exchange has witnessed the certificate (action not performed with Rosetta)
When exchange publishes this certificate
Then regestration transaction is accepted on the blockchain

Scenario: Valid case - publish stakepool registration certificate for a 3rd party pool
Given exchange holds funds in my address
And exchange has successfully constructed a stakepool registration certificate for a 3rd party pool
And exchange has witnessed the certificate (action not performed with Rosetta)
When exchange publishes this certificate
Then regestration transaction is accepted on the blockchain

Scenario: Invalid case - for a 3rd party pool (that I don't have control of?)
Given ...

Scenario: Invalid case - invalid witness
Given exchange holds funds in my address
And exchange has successfully constructed a stakepool registration certificate
And exchange has witnessed the certificate with a different key (is this possible?)
When exchange publishes this certificate
Then an error is returned
And regestration transaction is not accepted on the blockchain

Scenario: Invalid case - missing witness
Given exchange holds funds in my address
And exchange has successfully constructed a stakepool registration certificate
And exchange has not witnessed the certificate
When exchange publishes this certificate
Then an error is returned
And regestration transaction is not accepted on the blockchain

0 comments on commit 8a4517b

Please sign in to comment.