-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
… issues/799/tests/params * issues/799/merge/integration-app_x_sup-stake-evts: fix: add missing steps and update module name for moved param [Code Health] refactor: rename `ApplicationTransfer` msgs (#788) [Docs] Add operations documentation about proof submission fee (#806) [Testing] Fix non-idempotency in (and speed up) supplier staking tests (#815) [Application] feat: app stake transfer (#743) Empty commit chore: review feedback improvements
- Loading branch information
Showing
22 changed files
with
2,254 additions
and
185 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: App Stake Transfer Namespace | ||
|
||
Scenario: User can transfer Application stake to non-existing application address | ||
Given the user has the pocketd binary installed | ||
# Unstake the applications in case they're already staked. | ||
And this test ensures the "application" for account "app2" is not staked | ||
And this test ensures the "application" for account "app3" is not staked | ||
# Stake with 1 uPOKT more than the current stake used in genesis to make | ||
# the transaction succeed. | ||
And the account "app2" has a balance greater than "1000070" uPOKT | ||
And an account exists for "app3" | ||
And the user successfully stakes a "application" with "1000070" uPOKT for "anvil" service from the account "app2" | ||
When the user transfers the "application" stake from account "app2" to 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 "TransferApplication" message to be submitted | ||
And the "application" for account "app3" is staked with "1000070" uPOKT | ||
And the account balance of "app3" should be "0" uPOKT "less" than before | ||
And the user verifies the "application" for account "app2" is not staked | ||
And the account balance of "app2" should be "0" 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
//go:build e2e | ||
|
||
package e2e | ||
|
||
import ( | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func (s *suite) TheUserSuccessfullyStakesAWithUpoktForServiceFromTheAccount(actorType string, amount int64, serviceId, accName string) { | ||
s.TheUserStakesAWithUpoktForServiceFromTheAccount(actorType, amount, serviceId, accName) | ||
s.TheUserShouldBeAbleToSeeStandardOutputContaining("txhash:") | ||
s.TheUserShouldBeAbleToSeeStandardOutputContaining("code: 0") | ||
s.ThePocketdBinaryShouldExitWithoutError() | ||
s.TheUserShouldWaitForTheModuleMessageToBeSubmitted("application", "StakeApplication") | ||
s.TheForAccountIsStakedWithUpokt(actorType, accName, amount) | ||
s.TheAccountBalanceOfShouldBeUpoktThanBefore(accName, amount, "less") | ||
} | ||
|
||
func (s *suite) TheUserTransfersTheStakeFromAccountToAccount(actorType, fromAccName, toAccName string) { | ||
fromAddr, fromAddrIsFound := accNameToAddrMap[fromAccName] | ||
require.Truef(s, fromAddrIsFound, "account name %s not found in accNameToAddrMap", fromAccName) | ||
|
||
toAddr, toAddrIsFound := accNameToAddrMap[toAccName] | ||
require.Truef(s, toAddrIsFound, "account name %s not found in accNameToAddrMap", toAccName) | ||
|
||
args := []string{ | ||
"tx", | ||
actorType, | ||
"transfer", | ||
fromAddr, | ||
toAddr, | ||
"--from", | ||
fromAccName, | ||
keyRingFlag, | ||
chainIdFlag, | ||
"-y", | ||
} | ||
res, err := s.pocketd.RunCommandOnHost("", args...) | ||
require.NoError(s, err) | ||
|
||
s.pocketd.result = res | ||
} | ||
|
||
// This helper ensures that the actor is unstaked if it was staked when this step ran. | ||
func (s *suite) ThisTestEnsuresTheForAccountIsNotStaked(actorType, accName string) { | ||
if _, ok := s.getStakedAmount(actorType, accName); ok { | ||
s.TheUserUnstakesAFromTheAccount(actorType, accName) | ||
s.TheUserShouldBeAbleToSeeStandardOutputContaining("txhash:") | ||
s.TheUserShouldBeAbleToSeeStandardOutputContaining("code: 0") | ||
} | ||
} |
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.