Skip to content
Merged
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
21 changes: 21 additions & 0 deletions e2e_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ TEST_WALLET_MNEMONIC="your mnemonic here"
STAKE_POOL_HASH=d9812f8d30b5db4b03e5b76cfd242db9cd2763da4671ed062be808a0 # Required for stake delegation tests
DREP_KEY_HASH_ID=03ccae794affbe27a5f5f74da6266002db11daa6ae446aea783b972d # Required for DRep vote delegation tests with key_hash type
DREP_SCRIPT_HASH_ID=2d4cb680b5f400d3521d272b4295d61150e0eff3950ef4285406a953 # Required for DRep vote delegation tests with script_hash type
POOL_REGISTRATION_CERT=<hex-encoded-cert> # Required for poolRegistrationWithCert test
POOL_GOVERNANCE_PROPOSAL_ID=df58f714c0765f3489afb6909384a16c31d600695be7e86ff9c59cf2e8a48c7900 # Required for pool governance vote tests
POOL_VOTE_CHOICE=yes # Optional: Vote choice for pool governance vote (yes/no/abstain, default: yes)
```

## Usage
Expand Down Expand Up @@ -126,6 +129,17 @@ pytest --log-cli-level=INFO tests/test_stake_operations.py::test_drep_vote_deleg
pytest --log-cli-level=INFO tests/test_stake_operations.py::test_drep_vote_delegation_key_hash
pytest --log-cli-level=INFO tests/test_stake_operations.py::test_drep_vote_delegation_script_hash
pytest --log-cli-level=INFO tests/test_stake_operations.py::test_scenario_B_final_deregistration

# Pool operation tests

# Run all pool operation tests
pytest --log-cli-level=INFO tests/test_pool_operations.py

# Run specific pool operation tests
pytest --log-cli-level=INFO tests/test_pool_operations.py::test_pool_registration
pytest --log-cli-level=INFO tests/test_pool_operations.py::test_pool_registration_with_cert
pytest --log-cli-level=INFO tests/test_pool_operations.py::test_pool_governance_vote
pytest --log-cli-level=INFO tests/test_pool_operations.py::test_pool_retirement
```

## Test Scenarios
Expand All @@ -151,6 +165,13 @@ pytest --log-cli-level=INFO tests/test_stake_operations.py::test_scenario_B_fina
3. **DRep Vote Delegation - Key Hash**: Delegate voting power to a DRep with key hash
4. **DRep Vote Delegation - Script Hash**: Delegate voting power to a DRep with script hash

### Pool Operations

1. **Pool Registration**: Register a new stake pool with generated parameters
2. **Pool Registration With Certificate**: Register a pool using a pre-created certificate
3. **Pool Governance Vote**: Submit governance votes as a Stake Pool Operator (SPO)
4. **Pool Retirement**: Retire the registered stake pool and reclaim deposit

## API Coverage

The following Rosetta API endpoints are covered in our e2e tests:
Expand Down
22 changes: 22 additions & 0 deletions e2e_tests/example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Rosetta API endpoint (default: local testnet)
ROSETTA_ENDPOINT=http://localhost:8082/

# Network to use (mainnet, preprod, preview, testnet)
CARDANO_NETWORK=preprod

# Test wallet mnemonic - NEVER use a real wallet with funds
# Replace with your test wallet mnemonic
TEST_WALLET_MNEMONIC="test test test test test test test test test test test test"
STAKE_POOL_ID=d9812f8d30b5db4b03e5b76cfd242db9cd2763da4671ed062be808a0 # Required for stake delegation tests

# note: 22 and 23 are the prefix for the DRep key hash and script hash,
# and need to be removed for the actual hex got from explorers
# eg: #22 03ccae794affbe27a5f5f74da6266002db11daa6ae446aea783b972d - 22 for drep key hash
# eg: #23 2d4cb680b5f400d3521d272b4295d61150e0eff3950ef4285406a953 - 23 for drep script hash
DREP_KEY_HASH_ID=03ccae794affbe27a5f5f74da6266002db11daa6ae446aea783b972d # Required for DRep vote delegation tests with key_hash type
DREP_SCRIPT_HASH_ID=2d4cb680b5f400d3521d272b4295d61150e0eff3950ef4285406a953 # Required for DRep vote delegation tests with script_hash type

# Data for pool scenarios
POOL_REGISTRATION_CERT="8a03581c2dcfdb151c8f8688359b252034a987adb7ea952eefd1562e0fa3d6bd5820544a0e0979dbdcbbcfe8c2c93cf7c2007de142f25b4e7dc3afb1560410bee7b01a004c4b401a002dc6c0d81e820101581de06bc0fb7bf3fb63213db81655a33d8c4a7c1c7e4bd75fc33ff176784bd9010281581c6bc0fb7bf3fb63213db81655a33d8c4a7c1c7e4bd75fc33ff176784b8184001820445820f5d9505820f5d9ea167fd2e0b19647f18dd1e0826f706f6f6c4d6574616461746155726c58209ac2217288d1ae0b4e15c41b58d3e05a13206fd9ab81cb15943e4174bf30c90b"
POOL_GOVERNANCE_PROPOSAL_ID="c16d3ce65e05d1b439c32c336789565f10d59dbdf20742ac26b3c9cdc791469f00"
POOL_VOTE_CHOICE=yes
3 changes: 1 addition & 2 deletions e2e_tests/rosetta_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ def account_coins(self, address: str) -> Dict:
url = f"{self.endpoint}/account/coins"
payload = {
"network_identifier": self.network_identifier,
"account_identifier": {"address": address},
"include_mempool": False
"account_identifier": {"address": address}
}

try:
Expand Down
Loading