Skip to content

Commit 7320725

Browse files
author
James Browning
committed
Added some v1.2 BDD scenarios in Gherkin
1 parent 3f8eb2b commit 7320725

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed

bdd/features/delegation

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Feature: Delegation
2+
3+
Rule: Delegation transaction can be constructed
4+
5+
Scenario: Valid case
6+
Given exchange holds some funds in my address
7+
And my chosen stake pool is registered
8+
When I provide details of my delegation intent
9+
Then exchange can construct a transaction for this delegation
10+
And the delegation transaction matches my delegation intent
11+
12+
Scenario: Invalid case – no funds
13+
Given exchange holds no funds in my address
14+
When I provide details of my delegation intent
15+
Then an error is returned (this validation may not occur until submit)
16+
And exchange cannot construct a transaction for this delegation
17+
18+
Scenario: Invalid case – not enough funds to delegate (less than 2ADA)
19+
Given ...
20+
21+
Scenario: Invalid case – not my address (provide other pool id)
22+
Given ...
23+
24+
25+
Rule: Delegation transaction can be submitted
26+
27+
Scenario: Valid delegation transaction
28+
Given exchange holds funds in my address
29+
And exchange has constructed a valid delegation transaction
30+
When exchange submits the transaction
31+
Then a successful response is returned
32+
33+
Scenario: Invalid case – stakepool not registered
34+
Given exchange holds funds in my address
35+
And exchange has constructed a delegation transaction using a stakepool id that is not registered
36+
When exchange submits the transaction
37+
Then an error is returned
38+
And delegation is not accepted on the blockchain

bdd/features/pledge-to-stakepool

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Feature: Pledge to a stakepool
2+
3+
Rule: Pledging transaction can be constructed
4+
5+
Scenario: Valid case
6+
Given there is a stakepool for which I am the owner
7+
When I provide details of my pledging intent (consider using 'data table' with valid values)
8+
Then exchange can construct a transaction for my pledge
9+
And the delegation transaction matches my pledging intent
10+
11+
Scenario: Invalid case - no enough funds to pledge
12+
Given ...
13+
14+
Scenario: Invalid case - stakepool not registered
15+
Given ...
16+
17+
18+
Rule: Pledging transaction can be submitted
19+
20+
Scenario: Valid pledging transaction
21+
Given there is a stakepool for which I am the owner
22+
And exchange has constructed a valid pledging transaction
23+
When exchange submits the transaction
24+
Then a successful response is returned
25+
And pledge can be proven(?)
26+
27+
Scenario: Invalid case – stakepool not registered
28+
Given exchange has constructed a delegation transaction using a stakepool id that is not registered
29+
When exchange submits the transaction
30+
Then an error is returned
31+
And pledge is not accepted on the blockchain

bdd/features/register-stakepool-owner

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Feature: Register as stakepool owner
2+
3+
Rule: Constructing a stakepool registration certificate (this may be client-side only and not Rosetta)
4+
5+
Scenario: Valid case - constructing a stakepool registration certificate
6+
Given exchange holds funds in my address
7+
When exchange is provided with registration details
8+
Then exchange can successful construct a stakepool registration certiifcate
9+
10+
11+
Rule: Publishing a stakepool registration certificate
12+
13+
Scenario: Valid case - publish stakepool registration certificate for pool that I operate
14+
Given exchange holds funds in my address
15+
And exchange has successfully constructed a stakepool registration certificate for pool that I operate
16+
And exchange has witnessed the certificate (action not performed with Rosetta)
17+
When exchange publishes this certificate
18+
Then regestration transaction is accepted on the blockchain
19+
20+
Scenario: Valid case - publish stakepool registration certificate for a 3rd party pool
21+
Given exchange holds funds in my address
22+
And exchange has successfully constructed a stakepool registration certificate for a 3rd party pool
23+
And exchange has witnessed the certificate (action not performed with Rosetta)
24+
When exchange publishes this certificate
25+
Then regestration transaction is accepted on the blockchain
26+
27+
Scenario: Invalid case - for a 3rd party pool (that I don't have control of?)
28+
Given ...
29+
30+
Scenario: Invalid case - invalid witness
31+
Given exchange holds funds in my address
32+
And exchange has successfully constructed a stakepool registration certificate
33+
And exchange has witnessed the certificate with a different key (is this possible?)
34+
When exchange publishes this certificate
35+
Then an error is returned
36+
And regestration transaction is not accepted on the blockchain
37+
38+
Scenario: Invalid case - missing witness
39+
Given exchange holds funds in my address
40+
And exchange has successfully constructed a stakepool registration certificate
41+
And exchange has not witnessed the certificate
42+
When exchange publishes this certificate
43+
Then an error is returned
44+
And regestration transaction is not accepted on the blockchain

0 commit comments

Comments
 (0)