-
Notifications
You must be signed in to change notification settings - Fork 719
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pause * no vscode errors * rewrite go.sum, go.work.sum and fix amino import * remove mauth docs * gofumpt * fix find * cant get docker to build locally * debug ibc test * fix ibc test * passing e2e * clean up commented out tests * remove more mauth * forgot to save * add back middleware test * fix upgrade * fix test setup * add TODO note * remove multihop test * re-organized tests to make it easier to skip when working on a single one * remove gov tests * removed multihop tests
- Loading branch information
Showing
11 changed files
with
568 additions
and
475 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package e2e | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
func (s *IntegrationTestSuite) testBankTokenTransfer() { | ||
s.Run("send_photon_between_accounts", func() { | ||
var err error | ||
senderAddress := s.chainA.validators[0].keyInfo.GetAddress() | ||
sender := senderAddress.String() | ||
|
||
recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() | ||
recipient := recipientAddress.String() | ||
|
||
chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) | ||
|
||
var ( | ||
beforeSenderUAtomBalance sdk.Coin | ||
beforeRecipientUAtomBalance sdk.Coin | ||
) | ||
|
||
s.Require().Eventually( | ||
func() bool { | ||
beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) | ||
s.Require().NoError(err) | ||
|
||
beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) | ||
s.Require().NoError(err) | ||
|
||
return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() | ||
}, | ||
10*time.Second, | ||
5*time.Second, | ||
) | ||
|
||
s.execBankSend(s.chainA, 0, sender, recipient, tokenAmount.String(), standardFees.String(), false) | ||
|
||
s.Require().Eventually( | ||
func() bool { | ||
afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) | ||
s.Require().NoError(err) | ||
|
||
afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) | ||
s.Require().NoError(err) | ||
|
||
decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) | ||
incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) | ||
|
||
return decremented && incremented | ||
}, | ||
time.Minute, | ||
5*time.Second, | ||
) | ||
}) | ||
} |
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,22 @@ | ||
package e2e | ||
|
||
import ( | ||
"cosmossdk.io/math" | ||
) | ||
|
||
func (s *IntegrationTestSuite) testByPassMinFeeWithdrawReward() { | ||
paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() | ||
payee := s.chainA.validators[0].keyInfo.GetAddress() | ||
// pass | ||
s.T().Logf("bypass-msg with fee in the denom of global fee, pass") | ||
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), paidFeeAmt+uatomDenom, false) | ||
// pass | ||
s.T().Logf("bypass-msg with zero coin in the denom of global fee, pass") | ||
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), "0"+uatomDenom, false) | ||
// pass | ||
s.T().Logf("bypass-msg with zero coin not in the denom of global fee, pass") | ||
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), "0"+photonDenom, false) | ||
// fail | ||
s.T().Logf("bypass-msg with non-zero coin not in the denom of global fee, fail") | ||
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), paidFeeAmt+photonDenom, true) | ||
} |
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.