Skip to content

Use the Zone SDK to inscribe data on blockchain#351

Open
kashepavadan wants to merge 6 commits into
mainfrom
zone-sdk-inscribe
Open

Use the Zone SDK to inscribe data on blockchain#351
kashepavadan wants to merge 6 commits into
mainfrom
zone-sdk-inscribe

Conversation

@kashepavadan

Copy link
Copy Markdown
Contributor

No description provided.

@kashepavadan kashepavadan marked this pull request as ready for review June 19, 2026 02:31
@kashepavadan kashepavadan marked this pull request as draft June 19, 2026 02:31

@pradovic pradovic left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left two comments! Thanks!


// Watch for events
event = sequencer.next_event() => {
if let Some(event) = event {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next_event returns event not Option. Proposed fix: drop if let Some(event)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to keep it consistent with the implementation in the master branch of logos-blockchain, and that's how it is there: https://github.com/logos-blockchain/logos-blockchain/blob/5069049472419e6c92cae3e1393f5d99f20b359e/deployment/tui-zone/src/lib.rs#L69

If we want to modify it, we should change it there as well, no? @pradovic

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, It was on my PR that I just merged to master (I thought I already did)

Comment thread docs/blockchain/zone-sdk/inscribe-data-on-chain-using-zone-sdk.md Outdated

@weboko weboko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dogfooded on x86_64 Linux. Found a compile error that will block users from completing the tutorial.

The tui-zone-tutorial branch carries an older zone-sdk where ZoneSequencer::next_event() returns Option<Event> — the signature was changed to return Event directly on master after the tutorial branch was cut.

This means the tutorial code in Step 3 will not compile as written on the tutorial branch.

tokio::select! {

// Watch for events
event = sequencer.next_event() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compile error — on the tui-zone-tutorial branch, ZoneSequencer::next_event() returns Option<Event>, not Event. Binding event here therefore has type Option<Event>, but handle_event on line 386 expects Event. This causes:

error[E0308]: mismatched types
   --> src/lib.rs:112:30
    |
    | handle_event(event, ...)
    |              ^^^^^ expected `Event`, found `Option<Event>`

Verified with cargo check on the tutorial branch — the error is reproducible. On master the signature was changed to -> Event directly, which is why master compiles.

Suggested fix — use the Some(event) pattern in tokio::select! to unwrap and disable the arm on None:

Suggested change
event = sequencer.next_event() => {
Some(event) = sequencer.next_event() => {

Comment on lines +350 to +354
fn handle_event(
event: Event,
state: &mut InMemoryZoneState,
sequencer: &mut ZoneSequencer<NodeHttpClient>,
ready_tx: &mut Option<tokio::sync::oneshot::Sender<()>>,) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-standard formatting: the function parameters use 1-space indentation and the closing ) is on the same line as the last argument with a leading ,. This will pass rustfmt with a warning and looks inconsistent with the rest of the codebase (4-space indentation, closing ) on its own line).

Suggested fix:

Suggested change
fn handle_event(
event: Event,
state: &mut InMemoryZoneState,
sequencer: &mut ZoneSequencer<NodeHttpClient>,
ready_tx: &mut Option<tokio::sync::oneshot::Sender<()>>,) {
fn handle_event(
event: Event,
state: &mut InMemoryZoneState,
sequencer: &mut ZoneSequencer<NodeHttpClient>,
ready_tx: &mut Option<tokio::sync::oneshot::Sender<()>>,
) {

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants