diff --git a/README.md b/README.md index 518ec86..3e3df14 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ allium auth setup --method x402_key --private-key 0x... --network eip155:8453 allium auth setup --method x402_privy \ --privy-app-id ... --privy-app-secret ... \ --privy-wallet-id ... --network eip155:8453 -allium auth setup --method tempo --private-key 0x... --chain-id 42431 +allium auth setup --method tempo --private-key 0x... --chain-id 4217 ``` | Method | Description | @@ -227,7 +227,7 @@ allium auth setup # Non-interactive setup (for scripts/CI) allium auth setup --method api_key --api-key sk-... -allium auth setup --method tempo --private-key 0x... --chain-id 42431 +allium auth setup --method tempo --private-key 0x... --chain-id 4217 # List all configured profiles allium auth list diff --git a/cli/commands/auth.py b/cli/commands/auth.py index 68d93bf..ff31355 100644 --- a/cli/commands/auth.py +++ b/cli/commands/auth.py @@ -220,7 +220,7 @@ def _build_profile_from_args( @click.option( "--chain-id", default=None, - help="Tempo chain ID, e.g. 42431 (for tempo).", + help="Tempo chain ID, e.g. 4217 (for tempo).", ) @click.option("--privy-app-id", default=None, help="Privy App ID (for x402_privy).") @click.option( @@ -253,7 +253,7 @@ def auth_setup( \b allium auth setup allium auth setup --method api_key --api-key sk-... - allium auth setup --method tempo --private-key 0x... --chain-id 42431 + allium auth setup --method tempo --private-key 0x... --chain-id 4217 """ if method: profile = _build_profile_from_args( diff --git a/cli/types/enums.py b/cli/types/enums.py index adeb2b7..031c354 100644 --- a/cli/types/enums.py +++ b/cli/types/enums.py @@ -12,7 +12,6 @@ class AuthMethod(StrEnum): class TargetNetwork(StrEnum): BASE_MAINNET = "eip155:8453" - BASE_SEPOLIA = "eip155:84532" @property def label(self) -> str: @@ -21,13 +20,11 @@ def label(self) -> str: _NETWORK_LABELS: dict[TargetNetwork, str] = { TargetNetwork.BASE_MAINNET: "Base Mainnet", - TargetNetwork.BASE_SEPOLIA: "Base Sepolia (Testnet)", } class TempoChainId(StrEnum): MAINNET = "4217" - TESTNET = "42431" @property def label(self) -> str: @@ -36,7 +33,6 @@ def label(self) -> str: _TEMPO_LABELS: dict[TempoChainId, str] = { TempoChainId.MAINNET: "Tempo Mainnet", - TempoChainId.TESTNET: "Tempo Testnet", } diff --git a/cli/types/labels.py b/cli/types/labels.py index 05e2aa6..187139c 100644 --- a/cli/types/labels.py +++ b/cli/types/labels.py @@ -2,9 +2,7 @@ ALL_NETWORK_LABELS: dict[str, str] = { "eip155:8453": "Base Mainnet", - "eip155:84532": "Base Sepolia (Testnet)", "4217": "Tempo Mainnet", - "42431": "Tempo Testnet", } METHOD_LABELS: dict[str, str] = { diff --git a/release.sh b/release.sh index 22fcf88..fc1e808 100755 --- a/release.sh +++ b/release.sh @@ -13,6 +13,6 @@ fi git pull origin main --ff-only -cz bump +uv run cz bump git push origin main --tags diff --git a/tests/test_config.py b/tests/test_config.py index f411f34..68c4ba7 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -93,7 +93,7 @@ def test_multiple_profile_types(self, mgr): mgr.add_profile("key", ApiKeyProfile(api_key="sk-1")) mgr.add_profile( "tempo", - TempoProfile(private_key="0xabc", chain_id=TempoChainId.TESTNET), + TempoProfile(private_key="0xabc", chain_id=TempoChainId.MAINNET), ) profiles = mgr.list_profiles() assert isinstance(profiles["key"], ApiKeyProfile) diff --git a/tests/test_cost_log.py b/tests/test_cost_log.py index 152d63a..ca9aae1 100644 --- a/tests/test_cost_log.py +++ b/tests/test_cost_log.py @@ -54,7 +54,7 @@ def test_multiple_entries(self, log): log.log_payment( method="tempo", endpoint=f"/api/v1/test/{i}", - network="42431", + network="4217", raw_amount=str(100000 * (i + 1)), token="tempo", wallet="tempo-account", @@ -103,7 +103,7 @@ def test_groups_by_method_and_network(self, log): log.log_payment( method="tempo", endpoint="/c", - network="42431", + network="4217", raw_amount="500000", token="tempo", wallet="tempo", @@ -112,7 +112,7 @@ def test_groups_by_method_and_network(self, log): totals = log.total() assert totals["x402:eip155:8453"]["calls"] == 2 assert totals["x402:eip155:8453"]["amount"] == Decimal("3.000000") - assert totals["tempo:42431"]["calls"] == 1 + assert totals["tempo:4217"]["calls"] == 1 def test_empty_log(self, log): assert log.total() == {} diff --git a/tests/test_models.py b/tests/test_models.py index 2726eba..c97268e 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -31,9 +31,9 @@ def test_x402_key_roundtrip(self): assert p.target_network == TargetNetwork.BASE_MAINNET def test_tempo_roundtrip(self): - p = TempoProfile(private_key="0xabc", chain_id=TempoChainId.TESTNET) + p = TempoProfile(private_key="0xabc", chain_id=TempoChainId.MAINNET) assert p.method == "tempo" - assert p.chain_id == TempoChainId.TESTNET + assert p.chain_id == TempoChainId.MAINNET def test_discriminated_union_from_dict(self): config = AlliumConfig.model_validate( @@ -91,11 +91,9 @@ def test_auth_method_values(self): def test_target_network_label(self): assert TargetNetwork.BASE_MAINNET.label == "Base Mainnet" - assert TargetNetwork.BASE_SEPOLIA.label == "Base Sepolia (Testnet)" def test_tempo_chain_id_label(self): assert TempoChainId.MAINNET.label == "Tempo Mainnet" - assert TempoChainId.TESTNET.label == "Tempo Testnet" class TestGetTempoConfig: @@ -114,28 +112,13 @@ def test_mainnet_resolves_rpc_url(self): assert chain_id == 4217 assert rpc_url == CHAIN_RPC_URLS[4217] - def test_testnet_resolves_rpc_url(self): - from unittest.mock import patch - - from mpp.methods.tempo._defaults import CHAIN_RPC_URLS - - from cli.auth.tempo import TempoAccount, _get_tempo_config - - profile = TempoProfile( - private_key="0x" + "ab" * 32, chain_id=TempoChainId.TESTNET - ) - with patch.object(TempoAccount, "from_key", return_value=None): - _, rpc_url, chain_id = _get_tempo_config(profile) - assert chain_id == 42431 - assert rpc_url == CHAIN_RPC_URLS[42431] - def test_unsupported_chain_id_raises(self): from unittest.mock import patch from cli.auth.tempo import _get_tempo_config profile = TempoProfile( - private_key="0x" + "ab" * 32, chain_id=TempoChainId.TESTNET + private_key="0x" + "ab" * 32, chain_id=TempoChainId.MAINNET ) with patch.object(profile, "chain_id", "99999"): with pytest.raises(ValueError, match="Unsupported Tempo chain ID: 99999"): diff --git a/uv.lock b/uv.lock index 77f892c..fb19041 100644 --- a/uv.lock +++ b/uv.lock @@ -111,7 +111,7 @@ wheels = [ [[package]] name = "allium-cli" -version = "0.2.0" +version = "0.2.1" source = { editable = "." } dependencies = [ { name = "click" },