Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Stargate tests to mainnet #750

Open
wants to merge 2 commits into
base: live-prerelease
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions core/test/cosmos/transactions_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ TEST(CosmosTransactionTest, BuildSignedSendTxForBroadcast) {
"\"to_address\":\"cosmos1da6hgur4wsmpnjyg\"}"
"}],"
"\"signatures\":[{"
"\"account_number\":\"\","
"\"pub_key\":{\"type\":\"tendermint/PubKeySecp256k1\",\"value\":\"AsS+z2hDho2VVupD1GUYtRoTyxpIzWwFohwCnqQjH83k\"},"
"\"sequence\":\"\","
"\"signature\":\"9Nn7Az62vDLW0bMgdcO26kzOeVrtd/M0GxXFsePghch7lY098oi6/MFnr0zKoeyoPxLUjCISn6JRvpVJ22WmBg==\""
"}]}";
const auto tx = api::CosmosLikeTransactionBuilder::parseRawSignedTransaction(currencies::ATOM, strTx);
Expand Down Expand Up @@ -476,7 +478,7 @@ TEST(CosmosTransactionTest, BuildUnjailTxForBroadcast) {
TEST(CosmosTransactionTest, BuildSendTxForSignature) {
const std::string strTx = "{"
"\"account_number\":\"6571\","
"\"chain_id\":\"cosmoshub-3\","
"\"chain_id\":\"cosmoshub-4\","
"\"fee\":{\"amount\":[{\"amount\":\"5000\",\"denom\":\"uatom\"}],\"gas\":\"200000\"},"
"\"memo\":\"Sent from Ledger\","
"\"msgs\":[{"
Expand Down Expand Up @@ -506,7 +508,7 @@ TEST(CosmosTransactionTest, BuildNoFeeTxForBroadcast) {
"}}]}";
const std::string expected = "{"
"\"mode\":\"block\",\"tx\":{"
"\"fee\":{\"amount\":null,\"gas\":\"200000\"},"
"\"fee\":{\"amount\":[{\"amount\":\"0\",\"denom\":\"uatom\"}],\"gas\":\"200000\"},"
"\"memo\":\"Sent from Ledger\","
"\"msg\":[{"
"\"type\":\"cosmos-sdk/MsgWithdrawDelegationReward\","
Expand Down
28 changes: 18 additions & 10 deletions core/test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,26 @@ add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.Succe
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.Balances COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.Balances)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.ValidatorSet COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.ValidatorSet)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.ValidatorInfo COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.ValidatorInfo)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetAccountWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetAccountWithExplorer)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetAccountWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetAccountWithExplorer)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetErrorTransaction COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetErrorTransaction)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetSendWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetSendWithExplorer)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetDelegateWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetDelegateWithExplorer)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetCurrentBlockWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetCurrentBlockWithExplorer)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.AllTransactionsSynchronization COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.AllTransactionsSynchronization)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetSendWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetSendWithExplorer)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetDelegateWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetDelegateWithExplorer)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GetCurrentBlockWithExplorer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GetCurrentBlockWithExplorer)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.AllTransactionsSynchronization COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.AllTransactionsSynchronization)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.BalanceHistoryOperationQuery COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.BalanceHistoryOperationQuery)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GasLimitEstimationForTransfer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GasLimitEstimationForTransfer)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GasLimitEstimationForTransfer COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GasLimitEstimationForTransfer)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GasLimitEstimationForDelegation COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GasLimitEstimationForDelegation)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.InternalFeesMessageInTransaction COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.InternalFeesMessageInTransaction)

# These 2 tests demand that an account maintains unbondings and redelegations on chain
#
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.PendingUnbondings COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.PendingUnbondings)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.PendingRedelegations COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.PendingRedelegations)

# These 3 tests demand that the account is maintained in a state where the transaction
# would be legal, otherwise the gas estimation fails (node returns 5xx),
# and the cpp function returns 0 for the estimation
#
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GasLimitEstimationForWithdrawingRewards COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GasLimitEstimationForWithdrawingRewards)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GasLimitEstimationForDelegation COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GasLimitEstimationForDelegation)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GasLimitEstimationForUnDelegation COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GasLimitEstimationForUnDelegation)
# add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.GasLimitEstimationForRedelegation COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.GasLimitEstimationForRedelegation)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.PendingUnbondings COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.PendingUnbondings)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.PendingRedelegations COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.PendingRedelegations)
add_test (NAME ledger-core-integration-CosmosStargateWalletSynchronization.InternalFeesMessageInTransaction COMMAND ledger-core-integration-tests --gtest_filter=CosmosStargateWalletSynchronization.InternalFeesMessageInTransaction)
Loading