-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Application] Single Service Applications (#886)
## Summary This PR enforces staking `Application`s to have a single service, updates the tests and add documentation about the reasoning behind this enforcement. Note that the `Application.ServiceConfigs` remains a slice, reducing the codebase diff and allowing future multi-service `Applications` ## Issue Having `MaxClaimableAmount = Application.Stake * numSessionSuppliers` could allow `Application`s to over-service by making `Supplier`s of different session claim from the same stake. ![image](https://github.com/user-attachments/assets/f1396ea5-5788-4185-8a3c-4c8afc3429ef) - #750 (comment) ## Type of change Select one or more from the following: - [x] New feature, functionality or library - [x] Documentation ## Testing - [x] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable --------- Co-authored-by: Dmitry K <[email protected]>
- Loading branch information
Showing
18 changed files
with
136 additions
and
89 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
Feature: Stake App Namespaces | ||
|
||
# This test assume the account for app3 IS NOT STAKED at genesis | ||
Scenario: User can stake an Application waiting for it to unbond | ||
Given the user has the pocketd binary installed | ||
And the user verifies the "application" for account "app2" is not staked | ||
And the account "app2" has a balance greater than "1000070" uPOKT | ||
When the user stakes a "application" with "1000070" uPOKT for "anvil" service from the account "app2" | ||
And the user verifies the "application" for account "app3" is not staked | ||
And the account "app3" has a balance greater than "1000070" uPOKT | ||
When the user stakes a "application" with "1000070" uPOKT for "anvil" service from the account "app3" | ||
Then the user should be able to see standard output containing "txhash:" | ||
And the user should be able to see standard output containing "code: 0" | ||
And the pocketd binary should exit without error | ||
And the user should wait for the "application" module "StakeApplication" message to be submitted | ||
And the "application" for account "app2" is staked with "1000070" uPOKT | ||
And the account balance of "app2" should be "1000070" uPOKT "less" than before | ||
And the "application" for account "app3" is staked with "1000070" uPOKT | ||
And the account balance of "app3" should be "1000070" uPOKT "less" than before | ||
|
||
# Use the app3 account which is not staked at genesis time | ||
Scenario: User can unstake an Application | ||
Given the user has the pocketd binary installed | ||
And the "application" for account "app2" is staked with "1000070" uPOKT | ||
And an account exists for "app2" | ||
When the user unstakes a "application" from the account "app2" | ||
And the "application" for account "app3" is staked with "1000070" uPOKT | ||
And an account exists for "app3" | ||
When the user unstakes a "application" from the account "app3" | ||
Then the user should be able to see standard output containing "txhash:" | ||
And the user should be able to see standard output containing "code: 0" | ||
And the pocketd binary should exit without error | ||
And the application for account "app2" is in the "unbonding" period | ||
When the user waits for the application for account "app2" "unbonding" period to finish | ||
And the user verifies the "application" for account "app2" is not staked | ||
And the account balance of "app2" should be "1000070" uPOKT "more" than before | ||
And the application for account "app3" is in the "unbonding" period | ||
When the user waits for the application for account "app3" "unbonding" period to finish | ||
And the user verifies the "application" for account "app3" is not staked | ||
And the account balance of "app3" should be "1000070" uPOKT "more" than before |
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
Oops, something went wrong.