Skip to content

Fix Tutorial 1's __check_auth example to match the current CustomAccountInterface trait - #2686

Open
leighmcculloch wants to merge 1 commit into
stellar:mainfrom
leighmcculloch:fix-check-auth-tutorial-1-compile-errors
Open

Fix Tutorial 1's __check_auth example to match the current CustomAccountInterface trait#2686
leighmcculloch wants to merge 1 commit into
stellar:mainfrom
leighmcculloch:fix-check-auth-tutorial-1-compile-errors

Conversation

@leighmcculloch

Copy link
Copy Markdown
Member

What

Correct the custom account example's __check_auth signature to use the right signature-payload type, and make its Context match exhaustive against the current enum.

Why

As written, this tutorial's account contract does not compile against the current SDK, so anyone copying it hits a wall immediately — and it was already inconsistent with Tutorial 2 in the same file, which had the correct type.

…untInterface trait

### What
Correct the custom account example's `__check_auth` signature to use the right signature-payload type, and make its `Context` match exhaustive against the current enum.

### Why
As written, this tutorial's account contract does not compile against the current SDK, so anyone copying it hits a wall immediately — and it was already inconsistent with Tutorial 2 in the same file, which had the correct type.

Copilot AI 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.

Pull request overview

Updates Tutorial 1 for the current CustomAccountInterface and exhaustive Context matching.

Changes:

  • Changes signature payloads to Hash<32>.
  • Handles constructor contexts.
  • Blocking: both new Hash imports use the nonexistent crate-root export.

Recommendation: NEEDS-CHANGES — import crypto::Hash in both snippets.

Comments suppressed due to low confidence (1)

docs/build/guides/auth/check-auth-tutorials.mdx:264

  • The complete example repeats the invalid crate-root Hash import, so copying this advertised single-file version will not compile. Import Hash from soroban_sdk::crypto, as required by the current SDK.
    BytesN, Env, Hash, Symbol, Vec,

use soroban_sdk::{
auth::{Context, CustomAccountInterface}, contract, contracterror, contractimpl, contracttype, symbol_short, Address,
BytesN, Env, Symbol, Vec,
BytesN, Env, Hash, Symbol, Vec,
@stellar-jenkins-ci

Copy link
Copy Markdown

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.

2 participants