用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/genlayerlabs/intelligent-oracle --skill direct-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Design, deploy, and monitor a GenLayer Intelligent Oracle prediction market from any coding agent. Use when a user wants to create a settled-by-web-evidence prediction market without opening the web UI.
Deploy GenLayer intelligent contracts using the deployment script. User-invoked only.
Use the GenLayer CLI to inspect, interact with, and debug this repo's intelligent contracts.
| name | direct-tests |
| description | Write and run fast direct-mode pytest tests for this repo's GenLayer intelligent contracts. |
| allowed-tools | ["Bash","Read","Write","Edit"] |
Use this skill for fast contract logic checks that do not need a live GenLayer network.
This repo keeps Python contract tests in test/, not tests/direct/. The tests use the genlayer-test pytest plugin fixtures plus helpers in test/tools/.
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r test/requirements.txt -q
test/requirements.txt includes genlayer-test, which provides the direct_* pytest fixtures.
Run all Python contract tests:
python -m pytest test/ -v
Run one file or one scenario:
python -m pytest test/test_football_prediction_market_with_evidence_success.py -v
python -m pytest test/test_football_prediction_market_with_evidence_success.py::test_name -v
Always lint contracts first when contract files changed:
genvm-lint check intelligent-contracts/*.py
Existing tests use direct-mode fixtures such as:
def test_example(direct_vm, direct_deploy, direct_alice, tmp_path):
...
Common fixtures include direct_vm, direct_deploy, direct_alice, direct_bob, direct_charlie, direct_owner, and direct_accounts.
Use test/tools/contracts.py for repo-specific helpers:
ORACLE_CONTRACT_PATHdeploy_oracle_direct(...)mock_oracle_resolution(...)read_contract_source(...)deploy_oracle_direct(...) rewrites the contract header to py-genlayer-multi:test for direct-mode compatibility. Prefer using that helper instead of duplicating deploy setup.
For gl.nondet.web.get():
direct_vm.mock_web(r".*", {"status": 200, "body": b"<html>result</html>"})
For gl.nondet.exec_prompt():
direct_vm.mock_llm(
r".*",
json.dumps(
{
"valid_source": "true",
"event_has_occurred": "true",
"reasoning": "mocked direct-mode resolution",
"outcome": "Bayern Munich",
}
),
)
Reset mocks between scenarios when needed:
direct_vm.clear_mocks()
UNDETERMINED, ERROR, and revert paths.Direct mode runs the leader path only. Use integration tests or a live Studio smoke test when validator consensus behavior is the thing being verified.
基于 SOC 职业分类