本文へ移動
cccskills
無料GitHub で公開

integration-tests

Write and run integration tests against a GenLayer environment.

インストール方法を見る

含まれるファイル(3)

  • SKILL.md4.7 KB
  • agents/openai.yaml237 B
  • LICENSE1.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Integration Tests

Run contracts against a real GenLayer environment (GLSim, Studio, or testnet) with full consensus validation.

Running Tests

# Against default network (from gltest.config.yaml)
gltest tests/integration/ -v -s

# Against specific network
gltest tests/integration/ -v -s --network localnet
gltest tests/integration/ -v -s --network studionet
gltest tests/integration/ -v -s --network testnet_bradbury

Always use -v -s for visible output during development.

Test Pattern

from gltest import get_contract_factory
from gltest.assertions import tx_execution_succeeded

def test_full_flow():
    factory = get_contract_factory("MyContract")
    contract = factory.deploy(args=[])

    # Write methods return transaction receipts
    tx_receipt = contract.set_data(args=["hello"]).transact()
    assert tx_execution_succeeded(tx_receipt)

    # Read methods return values directly
    result = contract.get_data(args=[contract.address]).call()
    assert result == "hello"

ACCEPTED and FINALIZED are transaction lifecycle states, not proof that contract execution succeeded. A transaction can be accepted and finalized with an execution error, and failed execution applies no state changes. For deploy transactions, failed execution means no contract is created.

Always assert tx_execution_succeeded(receipt) before reading state, checking schema/code, or treating a missing contract as an infrastructure issue.

Key Differences from Direct Mode

Direct ModeIntegration Tests
Speed~30ms~seconds to minutes
Server requiredNoYes (GLSim, Studio, or testnet)
ConsensusLeader onlyFull leader + validators
Write methodsReturn values directlyReturn transaction receipts
Read methodsReturn values directlyUse .call()
Mockingmock_web() / mock_llm()Real web/LLM calls

Write vs Read Calls

Write methods (state-changing):

# .transact() submits and waits for consensus
tx_receipt = contract.method_name(args=[arg1, arg2]).transact()
assert tx_execution_succeeded(tx_receipt)

Read methods (view-only):

# .call() reads without transaction
result = contract.view_method(args=[arg1]).call()

Configuration (gltest.config.yaml)

contract_path: contracts/

networks:
  localnet:
    # GenLayer Studio running locally
  studionet:
    # studio.genlayer.com — gasless, no funding needed (0 GEN balance is fine)
  testnet_bradbury:
    accounts:
      - "${ACCOUNT_PRIVATE_KEY_1}"
      - "${ACCOUNT_PRIVATE_KEY_2}"

Test Markers

import pytest

@pytest.mark.slow
def test_expensive_operation():
    """Excluded by default. Run with: gltest -m slow"""
    pass

Environments

  • GLSim (pip install genlayer-test[sim], glsim --port 4000 --validators 5) — lightweight, no Docker, ~1s startup. Runs Python natively, not in GenVM. Good for fast iteration.
  • Studio local (genlayer up) — full GenVM, real consensus, Docker required. Validates runtime compatibility.
  • studio.genlayer.com (StudioNet) — hosted Studio, no setup, rate-limited (see Common Issues). Gasless: no tokens required. Accounts with 0 GEN balance can deploy and run tests normally.
  • Testnet Bradbury — real network, requires funded accounts.

When to Use Integration Tests

  • Validating consensus (leader + validators agree)
  • Testing real web requests and LLM calls
  • Pre-deployment smoke tests
  • Verifying contract works in actual GenVM (not just Python runner)

Direct mode should cover most logic testing. Use integration tests for final validation before deploying.

Common Issues

"Transaction not found" errors

Clear cache: rm -rf .gltest_cache

Slow tests

Run single tests during development:

gltest tests/integration/test_file.py::test_specific -v -s

JSON serialization

When working with mock validators, convert to dicts:

transaction_context = {"validators": [v.to_dict() for v in mock_validators]}

Studio rate limits (HTTP 429 / -32429)

studio.genlayer.com enforces per-IP limits: 60 req/min, 1000 req/hr, 10000 req/day. Limits aren't permanent — once tripped, further requests are rejected until the current window resets (next minute / hour / day cycle). Throttle batch tests, run heavy suites against localnet (GLSim or local Studio), or pace .transact() calls.

-32028 is the related pending-queue cap — up to 32 in-flight txs per sender; a separate cap also applies per contract to prevent flooding the shared Studio. Wait for receipts before submitting the next batch instead of firing in parallel.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

0G Compute Network guide for decentralized AI inference, fine-tuning, and GPU services. Covers chatbots, image generation, speech-to-text, SDK integration (0g-serving-broker), processResponse API, broker.inference methods, CLI commands (0g-compute-cli), and account management. Use this skill for any 0G compute, 0G AI, or decentralized GPU question.

日本語の概要は準備中です。原文の説明を表示しています。

internet-court/internet-court-skill6,7302026年8月20日 更新

Builds Agent-to-Agent (A2A) servers and clients following Google's open protocol for agent interoperability. Use when the user wants to create an A2A-compliant agent, build an Agent Card, implement task management, connect agents across frameworks, set up agent discovery, handle streaming responses, implement push notifications, or orchestrate multi-agent workflows. Trigger words: a2a, agent to agent, agent2agent, a2a protocol, a2a server, a2a client, agent card, agent interoperability, agent collaboration, multi-agent, agent discovery, a2a sdk, a2a task.

日本語の概要は準備中です。原文の説明を表示しています。

internet-court/internet-court-skill6,7302026年8月20日 更新

Give the AI agent its own EVM wallet with admin-controlled policies the agent CANNOT bypass even under prompt injection. Encrypted keystore (AES-256-GCM, scrypt KDF), policy file the agent has no tool to write, deterministic policy gate on every signing operation, optional local HTTP dashboard. Triggers: agent wallet, give the agent a wallet, agent address, fund the agent, agent autonomy, policy gate, kill switch, agent permissions, bounded autonomy, ERC-4337 alternative, session-key alternative.

日本語の概要は準備中です。原文の説明を表示しています。

internet-court/internet-court-skill6,7302026年8月20日 更新

Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.

日本語の概要は準備中です。原文の説明を表示しています。

internet-court/internet-court-skill6,7302026年8月20日 更新

Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK

日本語の概要は準備中です。原文の説明を表示しています。

internet-court/internet-court-skill6,7302026年8月20日 更新

Interact with Alkahest escrow contracts as a buyer, seller, or oracle using the CLI

日本語の概要は準備中です。原文の説明を表示しています。

internet-court/internet-court-skill6,7302026年8月20日 更新

internet-court のスキルをすべて見る

このスキルの問題を報告する