-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for HAL-01 - amount of cspr attached to pick_bid is now verified.
- Loading branch information
Showing
7 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
dao/tests/features/bid_escrow/picking_a_bid_without_paying.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Feature: Picking a bid without paying | ||
JobPoster posts a job, internal worker is bidding. | ||
Job Poster picks a bid of an Internal Worker, without sending exact amount of CSPR. | ||
Picking a bid is rejected. | ||
This is a presentation of HAL-01 issue fix. | ||
Background: | ||
Given following balances | ||
| account | CSPR balance | REP balance | REP stake | is_kyced | is_va | | ||
| BidEscrow | 0 | 0 | 0 | false | false | | ||
| MultisigWallet | 0 | 0 | 0 | false | false | | ||
| JobPoster | 1000 | 0 | 0 | true | false | | ||
| InternalWorker | 0 | 1000 | 0 | true | true | | ||
| VA1 | 0 | 1000 | 0 | true | true | | ||
| VA2 | 0 | 1000 | 0 | true | true | | ||
And following configuration | ||
| key | value | | ||
| TimeBetweenInformalAndFormalVoting | 0 | | ||
| VotingStartAfterJobSubmission | 0 | | ||
When JobPoster posted a JobOffer with expected timeframe of 14 days, maximum budget of 1000 CSPR and 400 CSPR DOS Fee | ||
And InternalWorker posted the Bid for JobOffer 0 with proposed timeframe of 7 days and 500 CSPR price and 100 REP stake | ||
And 8 days passed | ||
Then balances are | ||
| account | CSPR balance | REP balance | REP stake | | ||
# Initial 1000 + 400 dos fee. Notice lack of 500 CSPR payment from the bid. | ||
| BidEscrow | 400 | 0 | 0 | | ||
| JobPoster | 600 | 0 | 0 | | ||
| InternalWorker | 0 | 1000 | 100 | | ||
| VA1 | 0 | 1000 | 0 | | ||
| VA2 | 0 | 1000 | 0 | | ||
Scenario: JobPoster picked the Bid of InternalWorker without sending exact amount of CSPR | ||
# Following step will fail, before fix it would pass | ||
When JobPoster picked the Bid without paying for InternalWorker | ||
Then balances are | ||
| account | CSPR balance | REP balance | REP stake | | ||
# Initial 1000 + 400 dos fee. Notice lack of 500 CSPR payment from the bid. | ||
| BidEscrow | 400 | 0 | 0 | | ||
| JobPoster | 600 | 0 | 0 | | ||
| InternalWorker | 0 | 1000 | 100 | | ||
| VA1 | 0 | 1000 | 0 | | ||
| VA2 | 0 | 1000 | 0 | | ||
And the Bid of InternalWorker is in state Created |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters