|
95 | 95 | yarn starship:test |
96 | 96 | ``` |
97 | 97 |
|
| 98 | +### Available Tests |
| 99 | + |
| 100 | +The test suite includes comprehensive end-to-end tests covering various Cosmos SDK functionalities: |
| 101 | + |
| 102 | +#### Authorization Tests (`authz.test.ts`) |
| 103 | + |
| 104 | +Tests the Cosmos authz module functionality for delegating permissions between accounts: |
| 105 | + |
| 106 | +- **Grant Authorization**: Tests granting `SendAuthorization` with spending limits and `GenericAuthorization` for specific message types |
| 107 | +- **Execute Authorized Actions**: Tests executing transactions on behalf of another account using granted permissions |
| 108 | +- **Revoke Authorization**: Tests revoking previously granted authorizations |
| 109 | +- **Key Scenarios**: |
| 110 | + - Granting limited send authorization with spending caps |
| 111 | + - Granting generic authorization for voting |
| 112 | + - Executing send transactions through authorization |
| 113 | + - Verifying authorization limits are enforced |
| 114 | + - Cleaning up authorizations by revoking them |
| 115 | + |
| 116 | +#### Staking Tests (`staking.test.ts`) |
| 117 | + |
| 118 | +Tests Cosmos staking operations including delegation and validator interactions: |
| 119 | + |
| 120 | +- **Validator Discovery**: Queries and selects active validators for delegation |
| 121 | +- **Token Delegation**: Tests delegating tokens to validators using different signing modes |
| 122 | +- **Delegation Verification**: Verifies delegation amounts and validator assignments |
| 123 | +- **Key Scenarios**: |
| 124 | + - Querying bonded validators and selecting by stake amount |
| 125 | + - Delegating tokens using default, direct, and amino signing modes |
| 126 | + - Verifying delegation balances match expected amounts |
| 127 | + - Testing multiple delegation transactions to the same validator |
| 128 | + |
| 129 | +#### Token Transfer Tests (`token.test.ts`) |
| 130 | + |
| 131 | +Comprehensive testing of token transfers within and across chains: |
| 132 | + |
| 133 | +- **Direct Mode Transfers**: Tests token transfers using direct (protobuf) signing |
| 134 | +- **Amino Mode Transfers**: Tests token transfers using amino (JSON) signing |
| 135 | +- **WebSocket Event Monitoring**: Tests real-time transaction event monitoring via WebSocket |
| 136 | +- **IBC Transfers**: Tests cross-chain token transfers using IBC protocol |
| 137 | +- **Key Scenarios**: |
| 138 | + - Sending OSMO tokens between accounts with balance verification |
| 139 | + - Monitoring transfer events in real-time using WebSocket subscriptions |
| 140 | + - Cross-chain IBC transfers from Osmosis to Cosmos Hub |
| 141 | + - Verifying IBC token receipt and denomination tracing |
| 142 | + |
| 143 | +#### Governance Tests (`gov.test.ts`) |
| 144 | + |
| 145 | +Tests Cosmos governance functionality including proposals and voting: |
| 146 | + |
| 147 | +- **Proposal Submission**: Tests submitting text proposals to the governance module |
| 148 | +- **Voting Process**: Tests voting on proposals with different vote options |
| 149 | +- **Proposal Status Tracking**: Tests querying proposal status and vote tallies |
| 150 | +- **Validator Delegation**: Tests staking tokens to gain voting power |
| 151 | +- **Key Scenarios**: |
| 152 | + - Submitting governance proposals with proper deposits |
| 153 | + - Voting on proposals using different signers and vote options |
| 154 | + - Tracking proposal lifecycle from submission to completion |
| 155 | + - Verifying vote recording and tally calculations |
| 156 | + |
| 157 | +#### Broadcast Tests (`broadcast.test.ts`) |
| 158 | + |
| 159 | +Tests different transaction broadcasting methods and RPC functionality: |
| 160 | + |
| 161 | +- **Async Broadcasting**: Tests `broadcastTxAsync` for fire-and-forget transactions |
| 162 | +- **Sync Broadcasting**: Tests `broadcastTxSync` for immediate response transactions |
| 163 | +- **Commit Broadcasting**: Tests `broadcastTxCommit` for confirmed transactions |
| 164 | +- **Error Handling**: Tests proper error responses for invalid transactions |
| 165 | +- **Key Scenarios**: |
| 166 | + - Testing different broadcast modes with various transaction types |
| 167 | + - Verifying proper RPC response formats |
| 168 | + - Handling invalid transactions and signature errors |
| 169 | + - Testing broadcast method performance characteristics |
| 170 | + |
| 171 | +#### Query Client Tests (`query-client.test.ts`) |
| 172 | + |
| 173 | +Tests the Cosmos query client functionality and RPC endpoint interactions: |
| 174 | + |
| 175 | +- **RPC Connectivity**: Tests connection to Cosmos RPC endpoints |
| 176 | +- **Query Methods**: Tests various query methods for different modules |
| 177 | +- **Adapter Functionality**: Tests protocol adapters for different Cosmos versions |
| 178 | +- **Error Handling**: Tests proper error handling for failed queries |
| 179 | +- **Key Scenarios**: |
| 180 | + - Testing query client initialization and connection |
| 181 | + - Verifying query responses match expected formats |
| 182 | + - Testing different RPC adapter implementations |
| 183 | + - Handling network errors and timeouts gracefully |
| 184 | + |
| 185 | +#### Signer Method Tests (`signer-methods.test.ts`) |
| 186 | + |
| 187 | +Tests different signing methods and signer configurations: |
| 188 | + |
| 189 | +- **Direct Signing**: Tests protobuf-based transaction signing |
| 190 | +- **Amino Signing**: Tests JSON-based legacy transaction signing |
| 191 | +- **Signer Configuration**: Tests various signer configuration options |
| 192 | +- **Multi-Signature**: Tests multi-signature transaction workflows |
| 193 | +- **Key Scenarios**: |
| 194 | + - Comparing direct vs amino signing results |
| 195 | + - Testing signer configuration with different parameters |
| 196 | + - Verifying signature formats and compatibility |
| 197 | + - Testing multi-signature transaction creation and signing |
| 198 | + |
| 199 | +#### Setup Tests (`setup.test.ts`) |
| 200 | + |
| 201 | +Infrastructure and environment setup tests: |
| 202 | + |
| 203 | +- **Environment Validation**: Tests that the Starship environment is properly configured |
| 204 | +- **Chain Connectivity**: Tests connectivity to all configured chains |
| 205 | +- **Account Funding**: Tests faucet functionality for test account funding |
| 206 | +- **Service Health**: Tests that all required services are running and accessible |
| 207 | +- **Key Scenarios**: |
| 208 | + - Verifying Starship pods are running and healthy |
| 209 | + - Testing RPC endpoint accessibility |
| 210 | + - Validating test account creation and funding |
| 211 | + - Ensuring proper chain configuration and genesis state |
| 212 | + |
98 | 213 | ## 5. Stop the infra |
99 | 214 |
|
100 | 215 | The tests should be ideompotent, so the tests can be run multiple times (which is recommeded), since the time to spinup is still high (around 5 to 10 mins). |
|
0 commit comments