"""Test script for strands-erc8004

Requires a local Anvil node running: anvil --code-size-limit 100000
"""

from strands_erc8004 import blockchain, erc8004


def test_blockchain():
    """Test blockchain tool basics."""
    print("=== Blockchain Tool ===")

    # Create wallet
    result = blockchain(action="wallet_create", name="test-agent")
    print(f"wallet_create: {result}")

    # Check balance on local
    result = blockchain(
        action="balance",
        address="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
        chain="local",
    )
    print(f"balance: {result}")

    print("✅ Blockchain tool OK\n")


def test_erc8004():
    """Test ERC-8004 protocol."""
    print("=== ERC-8004 Tool ===")

    # Check status
    result = erc8004(action="status", chain="local")
    print(f"status: {result}")

    # Deploy all registries (requires Anvil + OpenZeppelin)
    # result = erc8004(action="deploy_all", chain="local")
    # print(f"deploy_all: {result}")

    # Create registration file
    result = erc8004(
        action="create_registration_file",
        agent_name="test-agent",
        description="A test agent for ERC-8004",
    )
    print(f"create_registration_file: {result}")

    print("✅ ERC-8004 tool OK\n")


if __name__ == "__main__":
    test_blockchain()
    test_erc8004()
