Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

docs: fix Event docstring examples to gl.chain.Event - #328

Open
dohernandez wants to merge 1 commit into
v0.3-devfrom
docs/fix-gl-event-docstring
Open

docs: fix Event docstring examples to gl.chain.Event#328
dohernandez wants to merge 1 commit into
v0.3-devfrom
docs/fix-gl-event-docstring

Conversation

@dohernandez

@dohernandez dohernandez commented Jul 21, 2026

Copy link
Copy Markdown
Member

Problem

The Event class docstring in runners/genlayer-py-std/src/genlayer/chain.py shows contract examples using gl.Event as the base class, but gl.Event does not resolve at runtime — Event is only exported under genlayer.chain. A contract copying the example crashes at module load with:

AttributeError: module 'genlayer' has no attribute 'Event'

Fix

This is Option 1 of #327: correct the docstring examples to the spelling that actually resolves, gl.chain.Event — matching what the genvm test fixtures already use (e.g. tests/cases/stable/py/events/post_event.py).

Changed: runners/genlayer-py-std/src/genlayer/chain.py (2 lines, both class TransferOccurredEvent(gl.Event):gl.chain.Event).

The doc/website/.../changelog-notes/v0.3.rst occurrences of gl.Event were intentionally left untouched — they document the v0.2.x → v0.3.0 migration and deliberately show the old spelling as the "before".

If the team prefers option 2 (exporting Event at top level so gl.Event becomes valid), feel free to close this in favor of that.

Summary by CodeRabbit

  • Documentation
    • Corrected the TransferOccurredEvent example to use the proper qualified event class reference.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
github-actions Bot changed the base branch from main to v0.3-dev July 21, 2026 16:30
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c83d505e-5849-43d6-9566-3e4f2644995b

📥 Commits

Reviewing files that changed from the base of the PR and between abb71bf and 26910d9.

📒 Files selected for processing (1)
  • runners/genlayer-py-std/src/genlayer/chain.py

📝 Walkthrough

Walkthrough

The Event class docstring example now uses gl.chain.Event instead of gl.Event; runtime behavior and method signatures remain unchanged.

Changes

Event documentation

Layer / File(s) Summary
Correct the Event example
runners/genlayer-py-std/src/genlayer/chain.py
The TransferOccurredEvent example now inherits from the qualified gl.chain.Event class.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the docstring example update from gl.Event to gl.chain.Event.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/fix-gl-event-docstring

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

👋 This PR targeted main, so I've retargeted it to the latest dev branch v0.3-dev.

main is protected and is only an alias of the latest release branch (v0.3-dev), kept in lockstep automatically. Active v0.3 work lands on v0.3-dev, which reaches v0.3.x through the standing release-gate PR once the cross-repo E2E matrix is green.

@dohernandez

Copy link
Copy Markdown
Member Author

Adopted and reviewed (genvm session). The two-line diff is correct and complete: a full-repo grep for gl.Event finds no other fixable site (the v0.3 changelog occurrences are labeled v0.2.x "before" examples and must stay; the events test fixture already uses gl.chain.Event). Option 2 of #327 (top-level alias restore) is rejected — rationale in #327 (comment) — so this PR is the intended fix. Ready for merge into v0.3-dev; docs-only, no runtime surface, safe to ride the next rc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants